Created
February 18, 2016 15:28
-
-
Save kopiro/f909bc801685ed748401 to your computer and use it in GitHub Desktop.
Generate a natural fingered-base entropy MD5
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Leap = require('/usr/local/lib/node_modules/leapjs'); | |
var Crypto = require("crypto"); | |
var hash = Crypto.createHash("md5"); | |
var hashCount = 0; | |
Leap.loop(function(frame){ | |
if (frame.hands && frame.hands.length > 0) { | |
var h = frame.hands[0]; | |
hash.update( JSON.stringify([ h.palmPosition, h.direction ]) ); | |
if (hashCount++ >= 200) { | |
console.log( hash.digest("hex") ); | |
process.exit(); | |
} | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment