Created
December 30, 2018 00:57
-
-
Save slugbyte/a6e9eb5c7c3dc2a3f28e0c1ed51704b4 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| 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