MCPcopy Create free account
hub / github.com/nodejs/node / validateHkdfDeriveBitsLength

Function validateHkdfDeriveBitsLength

lib/internal/crypto/hkdf.js:144–152  ·  view source on GitHub ↗
(length)

Source from the content-addressed store, hash-verified

142}
143
144function validateHkdfDeriveBitsLength(length) {
145 if (length === null)
146 throw lazyDOMException('length cannot be null', 'OperationError');
147 if (length % 8) {
148 throw lazyDOMException(
149 'length must be a multiple of 8',
150 'OperationError');
151 }
152}
153
154function hkdfDeriveBits(algorithm, baseKey, length) {
155 validateHkdfDeriveBitsLength(length);

Callers 1

hkdfDeriveBitsFunction · 0.85

Calls 1

lazyDOMExceptionFunction · 0.85

Tested by

no test coverage detected