chore: 优化支付提供者插件位置

This commit is contained in:
xiaojunnuo
2026-01-05 23:04:07 +08:00
parent 7ee39fd4ed
commit e500af1ed4
9 changed files with 525 additions and 136 deletions

View File

@@ -11,6 +11,10 @@ function hmacSha256(data: string, digest: BinaryToTextEncoding = "base64") {
return crypto.createHmac("sha256", data).update(Buffer.alloc(0)).digest(digest);
}
function hmacSha256WithKey(key: string, data: string, digest: BinaryToTextEncoding = "base64") {
return crypto.createHmac("sha256", key).update(data).digest(digest);
}
function base64(data: string) {
return Buffer.from(data).toString("base64");
}
@@ -39,4 +43,5 @@ export const hashUtils = {
toHex,
hexToStr,
hexToNumber,
hmacSha256WithKey,
};