public static byte[] SHA1(final byte[] message,final int offset,final int length){
  MessageDigest digest;
  try {
    digest=MessageDigest.getInstance("SHA-1");
    digest.update(message,offset,length);
    final byte[] sha1=digest.digest();
    return sha1;
  }
 catch (  final NoSuchAlgorithmException e) {
    if (Cfg.EXCEPTION) {
      Check.log(e);
    }
  }
  return null;
}

public static byte [ ] SHA1 ( final byte [ ] message , final int offset , final int length ) { MessageDigest digest ; try { digest = MessageDigest . getInstance ( "SHA-1" ) ; digest . update ( message , offset , length ) ; final byte [ ] sha1 = digest . digest ( ) ; return sha1 ; } catch ( final NoSuchAlgorithmException e ) { if ( Cfg . EXCEPTION ) { Check . log ( e ) ; } } return null ; }
calcola il sha1 del messaggio , usando la crypto api .
