Skip to content

Instantly share code, notes, and snippets.

@benfoxall
Created September 12, 2011 20:16
Show Gist options
  • Save benfoxall/1212270 to your computer and use it in GitHub Desktop.
Save benfoxall/1212270 to your computer and use it in GitHub Desktop.
$.ajaxSetup({
cache: true,
jsonpCallback:function(){
var key = this.data;
var h = 0;
for (var i=0; i < key.length; i++) {
h = (h + (key.charCodeAt(i)*i)) % 10000;
}
console.log(h,key);
return '_' + h;
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment