Skip to content

Instantly share code, notes, and snippets.

@slugbyte
Created December 30, 2018 00:57
Show Gist options
  • Select an option

  • Save slugbyte/a6e9eb5c7c3dc2a3f28e0c1ed51704b4 to your computer and use it in GitHub Desktop.

Select an option

Save slugbyte/a6e9eb5c7c3dc2a3f28e0c1ed51704b4 to your computer and use it in GitHub Desktop.
hash = (value) => {
if(isNaN(value)) return btoa("NaN" + Number.toString() + Number.name + Number.length)
switch(typeof value){
case 'function':
return btoa(value.name + value.length + value.toString())
default:
return btoa(JSON.stringify(value))
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment