Skip to content

Instantly share code, notes, and snippets.

View jweinsteincbt's full-sized avatar

Josh Weinstein jweinsteincbt

  • CBT Nuggets
  • Bend, OR
View GitHub Profile

Keybase proof

I hereby claim:

  • I am jweinsteincbt on github.
  • I am josh_crypto (https://keybase.io/josh_crypto) on keybase.
  • I have a public key ASBPiww1x9Vyhn9eTRmMFY64UBMLASib9YafRjsvuwcH7Qo

To claim this, I am signing this object:

@jweinsteincbt
jweinsteincbt / hashCode.js
Created May 10, 2016 16:48
Java hashCode in JavaScript
function hashCode(str) {
for(var i=0, total=0, len=str.length; i < len; ++i) {
total += str.charCodeAt(i)*Math.pow(31,(len - i - 1));
};
return total;
}