Refactor code structure for improved readability and maintainability

This commit is contained in:
2025-12-27 05:09:15 +00:00
parent 2d80d53b70
commit 8b95824cb6
7 changed files with 414 additions and 465 deletions
+2 -2
View File
@@ -121,7 +121,7 @@ export class LiteHashDRBG implements RNG {
return maxInt;
}
public nextBytes(bytes: number, baseBytes?: number): Uint8Array {
public nextBytes(bytes: number, baseBytes?: number): Uint8Array<ArrayBuffer> {
bytes |= 0;
if (bytes <= 0) {
throw new Error(`${bytes} <= 0`);
@@ -171,7 +171,7 @@ export class LiteHashDRBG implements RNG {
return result;
}
public nextBits(bits: number, baseBytes?: number): Uint8Array {
public nextBits(bits: number, baseBytes?: number): Uint8Array<ArrayBuffer> {
bits |= 0;
const bytes = (bits + 7) >> 3;
const headBits = bits & 0x7;