public static byte [ ] addressStringToBytes ( String hex ) { final byte [ ] addr ; try { addr = Hex . decode ( hex ) ; } catch ( DecoderException addressIsNotValid ) { return null ; } if ( isValidAddress ( addr ) ) return addr ; return null ; }
Decodes a hex string to address bytes and checks validity