feat: Update module exports and enhance TypeScript configuration

This commit is contained in:
2025-12-27 04:55:54 +00:00
parent b3875a111f
commit 2d80d53b70
12 changed files with 75 additions and 40 deletions
+5 -5
View File
@@ -1,9 +1,9 @@
import type { RNG } from './RNG';
import type { RNG } from './RNG.js';
import { sha512 } from 'js-sha512';
import { convertBytesLikeToUint8Array } from './convertBytesLikeToUint8Array';
import type { BytesLike } from './BytesLike';
import { convertBytesLikeToUint8Array } from './convertBytesLikeToUint8Array.js';
import type { BytesLike } from './BytesLike.js';
const maxRngSupportBit = 53;
const maxInt = 0x1f_ffff_ffff_ffff; // NOTE: b 0, 10000110011, 11...11
@@ -111,7 +111,7 @@ export class LiteHashDRBG implements RNG {
protected genNextBlock(): void {
this.hq.setUint32(this.hqIdxPos, this.stateIdx, true);
const digest = sha512.arrayBuffer(this.hq.buffer);
const digest = sha512.arrayBuffer(this.hq.buffer as ArrayBuffer);
this.buffer = digest;
this.bufferIdx = 0;
this.stateIdx += 1;
@@ -181,7 +181,7 @@ export class LiteHashDRBG implements RNG {
return result;
}
result[bytes - 1] &= 0xff >> (8 - headBits);
result[bytes - 1]! &= 0xff >> (8 - headBits);
return result;
}