Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public hashToken(token: string): number {
- let hash = 0;
- for (let i = 0; i < token.length; i++) {
- hash = ((hash + token.charCodeAt(i)) * this.base) % this.mod;
- }
- return hash;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement