Also implements HMAC
It also implements HMAC (keyed-Hash Message Authentication Code). Secure Hash Algorithm is defined by FIPS PUB 180-2 and FIPS PUB 198-1 in the following documents http://csrc.nist.gov/publications/fips/fips180-2/fips180-2withchangenotice.pdf / http://csrc.nist.gov/publications/fips/fips198-1/FIPS-198-1_final.pdf.
Getting started with jsSHA
Then, you will have to call the function using the hashed string and the algorithm. For example, you should use the var hash = hex_sha("This is a Test", "SHA-512"); code to achieve that. More details and examples are found on the project’s website.
The jsSHA software makes use of the Google Closure Compiler to reduce filesizes, as well as to boost performance. If you want to compile the sha_dev.js script into a customized output file, you must use the ‘java -jar compiler.jar --define="SUPPORTED_ALGS=" --externs /path/to/build/externs.js --warning_level VERBOSE --compilation_level ADVANCED_OPTIMIZATIONS --js /path/to/sha_dev.js --js_output_file /path/to/sha.js’ command, where FLAG can be one of the following values (1 for SHA-1, 4 for SHA-384/SHA-512, 2 for SHA-224/256) or bitwise.