Skip to content

Tutorial for MessageDigest class

Kenji Urushima edited this page May 10, 2013 · 14 revisions

The KJUR.crypto.MessageDigest class is a very similar to Java [java.security.MessageDigest] (http://docs.oracle.com/javase/7/docs/api/index.html?java/security/MessageDigest.html) class for cryptographic hash algorithm calculation.

Getting Started

Here is a basic sample for 'SHA1' hash calculation.

'// initialize' 'var md = new KJUR.crypto.MessageDigest({"alg": "sha1", "prov": "cryptojs"});' '// update data' 'md.updateString('aaa')' '// SHA1 hash result of string aaa' 'var hashValueHex = md.digest()'

Clone this wiki locally