Files
NapCatQQ/.pnpm-store/v3/files/5b/2b69445e8c91abbc445e00267cacc03ee1088c0119ef64e384380bb025bbe5e2bfc117c563b55aad12d330f3cd3e05b5979367c3eb0119b375425699b217a3
T
TanTan e311ca3275
Build NapCat Artifacts / Type Check & Test (push) Waiting to run
docs: 仓库链接指向本镜像仓库
2026-11-13 09:25:58 +08:00

16 lines
440 B
Plaintext

/**
* Transforms the input into a className.
* The multiplication constant 101 is selected to be a prime,
* as is the initial value of 11.
* The intermediate and final results are truncated into 32-bit
* unsigned integers.
* @param {String} str
* @returns {String}
*/
export let toHash = (str) => {
let i = 0,
out = 11;
while (i < str.length) out = (101 * out + str.charCodeAt(i++)) >>> 0;
return 'go' + out;
};