The goals of this project are:
Input must be an ASCII string - if character codes outside the range 0-255 are received,
undefined is returned.
The code (
sha256.min.js) defines the
sha256(string) function, which returns the hexadecimal-encoded SHA-256 hash of the input string.
AMD is also supported - use
If you're on Node, you should probably use the version from the built-in
However, it is made available as a CommonJS module, including the source code for the minified version:
var sha256 = ;var jsCode = sha256code + 'alert(sha256("hello!"));';
This library is released as "public domain". You can copy, modify, re-release and re-license, or incorporate into any other project without restriction of any kind.