StaticnewCreates a new HKDFRng with a custom page length.
The seed material to derive random numbers from
A salt value to mix with the key material
The number of bytes to generate in each HKDF call
A new HKDFRng instance configured with the specified parameters
StaticnewCreates a new HKDFRng with the default page length of 32 bytes.
The seed material to derive random numbers from
A salt value to mix with the key material
A new HKDFRng instance configured with the specified key material and salt
Generates deterministic random bytes.
The number of bytes to generate
A Uint8Array of random bytes
Fills the provided buffer with deterministic random bytes.
The buffer to fill with random bytes
Generates a random u32 value.
A deterministic random 32-bit unsigned integer
Generates a random u64 value.
Note: JavaScript numbers can only safely represent integers up to 2^53 - 1, so this returns a BigInt for full 64-bit precision.
A deterministic random 64-bit unsigned integer as BigInt
Attempts to fill the provided buffer with random bytes. This implementation never fails.
The buffer to fill with random bytes
Fills the provided buffer with deterministic random bytes. Alias for fillBytes for interface compatibility.
The buffer to fill with random bytes
Returns the key material (for testing purposes).
Returns the salt (for testing purposes).
Returns the page length (for testing purposes).
Returns the current page index (for testing purposes).
A deterministic random number generator based on HKDF-HMAC-SHA256.
Implements the RandomNumberGenerator interface from @bcts/rand.