public static String computeChainingValue(final String input,final RKSuiteIdentifier rkSuite) throws NoSuchAlgorithmException {
  final MessageDigest md=MessageDigest.getInstance(rkSuite.getHashAlgorithmForPreviousSignatureValue());
  md.update(input.getBytes());
  final byte[] digest=md.digest();
  final int bytesToExtract=rkSuite.getNumberOfBytesExtractedFromPrevSigHash();
  final byte[] conDigest=new byte[bytesToExtract];
  System.arraycopy(digest,0,conDigest,0,bytesToExtract);
  return CashBoxUtils.base64Encode(conDigest,false);
}

public static String computeChainingValue ( final String input , final RKSuiteIdentifier rkSuite ) throws NoSuchAlgorithmException { final MessageDigest md = MessageDigest . getInstance ( rkSuite . getHashAlgorithmForPreviousSignatureValue ( ) ) ; md . update ( input . getBytes ( ) ) ; final byte [ ] digest = md . digest ( ) ; final int bytesToExtract = rkSuite . getNumberOfBytesExtractedFromPrevSigHash ( ) ; final byte [ ] conDigest = new byte [ bytesToExtract ] ; System . arraycopy ( digest , 0 , conDigest , 0 , bytesToExtract ) ; return CashBoxUtils . base64Encode ( conDigest , false ) ; }
computing chaining value for input receipt
