Skip to content

Instantly share code, notes, and snippets.

@jjhesk
Created January 6, 2019 14:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jjhesk/0ed1f0afb62882007605149aa84e2f9e to your computer and use it in GitHub Desktop.
Save jjhesk/0ed1f0afb62882007605149aa84e2f9e to your computer and use it in GitHub Desktop.
jschecker.js
function check(event) {
var randomize = document.getElementById('randomize').value;
// var pattern = /"(.+?)" "(.+?)" "(.+?)" "(.+?)"/;
var ss, ssh, cs, nb, sn;
clear();
if (randomize.length > 64) {
ss = String(randomize).substring(-8,0);
ssh = hex2a(ss);
cs = ssh / 100000;
println(cs);
}
}
function hex2a(hexx) {
var hex = hexx.toString();//force conversion
var str = '';
for (var i = 0; (i < hex.length && hex.substr(i, 2) !== '00'); i += 2)
str += String.fromCharCode(parseInt(hex.substr(i, 2), 16));
return str;
}
function clear() {
results.innerHTML = '';
}
function println(s) {
results.innerHTML += s + '<br/>';
}
var results = document.getElementById('results');
document.getElementById('verify').addEventListener('click', check);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment