mirror of
https://github.com/certd/certd.git
synced 2026-04-14 20:40:53 +08:00
chore: 优化支付提供者插件位置
This commit is contained in:
@@ -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,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user