public static byte [ ] fromHex ( String hex ) { char [ ] c = hex . toCharArray ( ) ; byte [ ] b = new byte [ c . length / 2 ] ; for ( int i = 0 ; i < b . length ; i ++ ) { b [ i ] = ( byte ) ( HEX_DECODE_CHAR [ c [ i * 2 ] & 0xFF ] * 16 + HEX_DECODE_CHAR [ c [ i * 2 + 1 ] & 0xFF ] ) ; } return b ; }
Decode from hexadecimal