Last active
December 12, 2015 04:18
-
-
Save tianshuo/4713359 to your computer and use it in GitHub Desktop.
Hash Algorithm from http://www.hellocq.net/forum/simple/?t284938.html
This file contains 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
//This algorithm is from http://www.hellocq.net/forum/simple/?t284938.html | |
function dohash(theCall){ | |
var hash=0x73e2; | |
var rootCall=theCall.split("-")[0].toUpperCase(); | |
for(var i=0;i<rootCall.length;i+=2){ | |
hash^=rootCall.charCodeAt(i)<<8; | |
hash^=rootCall.charCodeAt(i+1); | |
} | |
return hash & 0x7fff; | |
} | |
var theCall=prompt("Enter Your Number","BG6LKT"); | |
var ans=dohash(theCall); | |
document.write(ans); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment