Ultrathin Pd and Pt nanowires for potential applications as hydrogen economy