Skip to content

Instantly share code, notes, and snippets.

@glynrob
Created October 20, 2013 16:10
Show Gist options
  • Save glynrob/7071624 to your computer and use it in GitHub Desktop.
Save glynrob/7071624 to your computer and use it in GitHub Desktop.
/* POLYCRYPT HASH */
function polycryptHash(){
var polystring=util.str2abv(password);
var op=window.polycrypt.digest("SHA-256",polystring);
op.oncomplete=function(e){
var hex=util.abv2hex(e.target.result);
// hex is the hash
}
}
window.polycrypt.onalive=polycryptHash;
/* CRYPTOJS HASH */
var cryptohash = CryptoJS.SHA256(password);
/* SJCL HASH */
var bitArray = sjcl.hash.sha256.hash(password);
var digest_sha256 = sjcl.codec.hex.fromBits(bitArray);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment