MCPcopy Create free account
hub / github.com/chhoumann/quickadd / hashSecretId

Function hashSecretId

src/utils/userScriptSecrets.ts:69–76  ·  view source on GitHub ↗
(value: string)

Source from the content-addressed store, hash-verified

67}
68
69function 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
78function truncateSecretIdPart(value: string, maxLength: number): string {
79 if (value.length <= maxLength) return value;

Callers 1

fitSecretIdFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected