Created
November 18, 2014 15:48
-
-
Save amwmedia/d31db3e0106e3a9175b7 to your computer and use it in GitHub Desktop.
XXHash // source http://jsbin.com/cegana
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta name="description" content="XXHash" /> | |
<meta charset="utf-8"> | |
<title>JS Bin</title> | |
<script src="https://rawgit.com/pierrec/js-xxhash/master/build/xxhash.min.lmd.js"></script> | |
<style id="jsbin-css"> | |
html, body { | |
height: 80%; | |
} | |
textarea { | |
display: block; | |
width: 100%; | |
height: 100%; | |
} | |
</style> | |
</head> | |
<body> | |
<textarea id="input"></textarea><br> | |
<button onClick="go()">GO</button> | |
<script id="jsbin-javascript"> | |
console.clear(); | |
var seed = 123456789; | |
function hash(text) { | |
return XXH(text, seed).toString(16); | |
} | |
function go() { | |
console.clear(); | |
var input = document.getElementById('input').value; | |
console.time('hash'); | |
var outHash = hash(input); | |
console.timeEnd('hash'); | |
console.log(outHash); | |
} | |
</script> | |
<script id="jsbin-source-css" type="text/css">html, body { | |
height: 80%; | |
} | |
textarea { | |
display: block; | |
width: 100%; | |
height: 100%; | |
}</script> | |
<script id="jsbin-source-javascript" type="text/javascript">console.clear(); | |
var seed = 123456789; | |
function hash(text) { | |
return XXH(text, seed).toString(16); | |
} | |
function go() { | |
console.clear(); | |
var input = document.getElementById('input').value; | |
console.time('hash'); | |
var outHash = hash(input); | |
console.timeEnd('hash'); | |
console.log(outHash); | |
}</script></body> | |
</html> |
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
html, body { | |
height: 80%; | |
} | |
textarea { | |
display: block; | |
width: 100%; | |
height: 100%; | |
} |
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
console.clear(); | |
var seed = 123456789; | |
function hash(text) { | |
return XXH(text, seed).toString(16); | |
} | |
function go() { | |
console.clear(); | |
var input = document.getElementById('input').value; | |
console.time('hash'); | |
var outHash = hash(input); | |
console.timeEnd('hash'); | |
console.log(outHash); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment