public static byte [ ] sha1 ( byte [ ] input ) { MessageDigest messageDigest = sha1Digest . get ( ) ; if ( messageDigest == null ) { try { messageDigest = MessageDigest . getInstance ( "SHA1" ) ; sha1Digest . set ( messageDigest ) ; } catch ( NoSuchAlgorithmException e ) { throw new UaRuntimeException ( StatusCodes . Bad_InternalError , e ) ; } } return messageDigest . digest ( input ) ; }
Compute the SHA1 digest for a given input .