(str: string)
| 106 | |
| 107 | static hashCode(str: string): bigint { |
| 108 | const upper: string = str.toUpperCase(); |
| 109 | let hash: bigint = 0n; |
| 110 | |
| 111 | for (let i: number = 0; i < upper.length; i++) { |
| 112 | hash = hash * 61n + BigInt(upper.charCodeAt(i)) - 32n; |
| 113 | hash = (hash + (hash >> 56n)) & 0xffffffffffffffn; |
| 114 | } |
| 115 | |
| 116 | return hash; |
| 117 | } |
| 118 | } |