chore: update to version 14.0.11 and align website URLs

This commit is contained in:
2026-01-11 11:34:13 +03:00
parent ef74383349
commit 19c8d69bd8
1499 changed files with 53633 additions and 89 deletions
+36
View File
@@ -0,0 +1,36 @@
import { hmac } from '@noble/hashes/hmac';
import { sha256 } from '@noble/hashes/sha256';
import { sha512 } from '@noble/hashes/sha512';
import { hasBigInt, u8aToU8a } from '@pezkuwi/util';
import { hmacSha256, hmacSha512, isReady } from '@pezkuwi/wasm-crypto';
const JS_HASH = {
256: sha256,
512: sha512
};
const WA_MHAC = {
256: hmacSha256,
512: hmacSha512
};
function createSha(bitLength) {
return (key, data, onlyJs) => hmacShaAsU8a(key, data, bitLength, onlyJs);
}
/**
* @name hmacShaAsU8a
* @description creates a Hmac Sha (256/512) Uint8Array from the key & data
*/
export function hmacShaAsU8a(key, data, bitLength = 256, onlyJs) {
const u8aKey = u8aToU8a(key);
return !hasBigInt || (!onlyJs && isReady())
? WA_MHAC[bitLength](u8aKey, data)
: hmac(JS_HASH[bitLength], u8aKey, data);
}
/**
* @name hmacSha256AsU8a
* @description creates a Hmac Sha256 Uint8Array from the key & data
*/
export const hmacSha256AsU8a = /*#__PURE__*/ createSha(256);
/**
* @name hmacSha512AsU8a
* @description creates a Hmac Sha512 Uint8Array from the key & data
*/
export const hmacSha512AsU8a = /*#__PURE__*/ createSha(512);