public static String hexSHA1 ( String value ) { try { MessageDigest md ; md = MessageDigest . getInstance ( "SHA-1" ) ; md . update ( value . getBytes ( "utf-8" ) ) ; byte [ ] digest = md . digest ( ) ; return byteToHexString ( digest ) ; } catch ( Exception ex ) { throw new UnexpectedException ( ex ) ; } }
Build an hexadecimal SHA1 hash for a String