Added convertBinToHex
Implement generateDigest