XXHash
// source http://jsbin.com/cegana
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);
}
html, body {
height: 80%;
}
textarea {
display: block;
width: 100%;
height: 100%;
}
<!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>