MCPcopy Index your code
hub / github.com/nodejs/node / numBitsToBytes

Function numBitsToBytes

lib/internal/crypto/util.js:559–561  ·  view source on GitHub ↗

* Converts a bit length to the number of bytes needed to contain it. * Non-byte lengths are rounded up to the next byte. * @param {number} length * @returns {number}

(length)

Source from the content-addressed store, hash-verified

557 * @returns {number}
558 */
559function numBitsToBytes(length) {
560 return MathFloor(length / 8) + MathFloor((7 + (length % 8)) / 8);
561}
562
563/**
564 * Copies `bytes` up to the byte length needed for `length` bits, then clears

Callers 6

truncateToBitLengthFunction · 0.85
supportsMethod · 0.85
normalizeKeyLengthFunction · 0.85
asyncDigestFunction · 0.85
ecdhDeriveBitsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…