jsSHA is a JavaScript implementation of the entire family of SHA hashes as defined in FIPS 180-2 (SHA-1, SHA-224, SHA-256, SHA-384, and SHA-512).
Despite JavaScript not natively supporting 64-bit operations, SHA-384 and SHA-512 are even implemented! jsSHA is also 100% cross-browser compatible.
Usage
Include the desired JavaScript file - sha.js, sha1.js, sha256.js, or sha512.js - in your header (sha.js used below):
< script type="text/javascript" src="/path/to/sha.js" >
Call the function with your string to be hashed and the algorithm to hash it ("This is a Test" and "SHA-512" were used below, respectively):
var hash = hex_sha("This is a Test", "SHA-512");
Product's homepage
What's New in This Release: [ read full changelog ]
· The way that classes are declared was changed.
· Several methods and properties were moved to class scope, reducing overall memory usage of the library.
· Several small optimizations that speed up the hash generation were also made.