private static String byteArray2Hex ( final byte [ ] hash ) { try ( Formatter formatter = new Formatter ( ) ; ) { for ( byte b : hash ) { formatter . format ( "%02x" , b ) ; } String hex = formatter . toString ( ) ; return hex ; } }
Converts an input byte array to a hex encoded String .