Skip to content

Instantly share code, notes, and snippets.

@JeffCave
JeffCave / .block
Last active August 8, 2018 21:58 — forked from mbostock/.block
TELE 1070 - Assig3 - graph
license: gpl-3.0
height: 600
@JeffCave
JeffCave / CryptoJS_byteArrayConversions.js
Last active May 9, 2017 07:50 — forked from artjomb/CryptoJS_byteArrayWordArrayConversions.js
Convert a byte array to a word array and back in CryptoJS-compatible fashion
/**
* EXAMPLE
* var myhash = CryptoJS.HmacSHA1(mine[2], secret);
* myhash = byteArrayConversion(myhash);
*/
function wordArrayToByteArray(hash){
return hash.words
//map each word to an array of bytes
.map(function(v){
// create an array of 4 bytes (less if sigBytes says we have run out)