This commit is contained in:
houjunxiang
2025-10-09 18:19:55 +08:00
parent f2ffc65094
commit 386f1e7466
1553 changed files with 284685 additions and 32820 deletions

View File

@@ -0,0 +1,11 @@
// 32 位整数无符号循环左移
export const leftShift = (a, n) => {
n = n % 32
return (a << n) | (a >>> (32 - n))
}
// 补全 16 进制字符串
export const leftPad = (str, num) => {
const padding = num - str.length
return (padding > 0 ? '0'.repeat(padding) : '') + str
}