question: public static String toHexString ( byte [ ] bytes ) { return String . format ( Locale . US , "%0" + ( bytes . length << 1 ) + "x" , new BigInteger ( 1 , bytes ) ) ; }
target:  Converts the given bytes to a hexidecimal strings including leading zeros. If you do not need leading zeros, you can use Java's toString(16) instead.