(value: string)
| 67 | } |
| 68 | |
| 69 | function hashSecretId(value: string): string { |
| 70 | let hash = 5381; |
| 71 | for (let index = 0; index < value.length; index += 1) { |
| 72 | hash = (hash * 33) ^ value.charCodeAt(index); |
| 73 | } |
| 74 | |
| 75 | return (hash >>> 0).toString(36).slice(0, SECRET_ID_HASH_LENGTH); |
| 76 | } |
| 77 | |
| 78 | function truncateSecretIdPart(value: string, maxLength: number): string { |
| 79 | if (value.length <= maxLength) return value; |