Derives deterministic, domain-separated bytes with HKDF-SHA-256.
The same base, domain, and byteLength always produce the same bytes.
Use a distinct domain for each purpose so one base value can safely feed
independent derivation contexts. The inputs are not modified.
Parameters
base: Uint8Array<ArrayBufferLike>
Salt that namespaces the derivation under a base value.
domain: Uint8Array<ArrayBufferLike>
HKDF context information identifying the derived value's use.
byteLength: number
Number of output bytes to derive.
Returns Promise<Uint8Array<ArrayBuffer>>
A promise that resolves to exactly byteLength derived bytes.
Throws
A DOMException when Web Crypto rejects an unsupported or invalid
derivation request, including an invalid output length.
Example: Derive a 32-byte key for one application domain.
Derives deterministic, domain-separated bytes with HKDF-SHA-256.
The same
base,domain, andbyteLengthalways produce the same bytes. Use a distinct domain for each purpose so one base value can safely feed independent derivation contexts. The inputs are not modified.