(str: string)
| 329 | * @internal please do not use. |
| 330 | */ |
| 331 | export function hashCode(str: string): string { |
| 332 | // tslint:disable:no-bitwise |
| 333 | let hash = 0; |
| 334 | const length = typeof str === 'string' ? str.length : 0; |
| 335 | if (length === 0) { |
| 336 | return String(hash); |
| 337 | } |
| 338 | for (let i = 0; i < length; i++) { |
| 339 | hash = (hash << 5) - hash + str.charCodeAt(i); |
| 340 | hash |= 0; // Convert to 32bit integer |
| 341 | } |
| 342 | hash = hash >>> 0; |
| 343 | return Number(hash).toString(32).toUpperCase(); |
| 344 | // tslint:enable:no-bitwise |
| 345 | } |
| 346 | |
| 347 | /** |
| 348 | * @internal please do not use. |
no outgoing calls
no test coverage detected