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

Function getUsagesMask

lib/internal/crypto/util.js:863–872  ·  view source on GitHub ↗

* Returns a bit mask representing the usages from `usageSet`. * @param {SafeSet } usageSet * @returns {number}

(usageSet)

Source from the content-addressed store, hash-verified

861 * @returns {number}
862 */
863function getUsagesMask(usageSet) {
864 // No usages is a valid state for some public keys, represented by a
865 // zero mask.
866 if (usageSet.size === 0) return 0;
867 let mask = 0;
868 for (const usage of usageSet) {
869 mask |= kUsageMasks[usage];
870 }
871 return mask;
872}
873
874/**
875 * Returns whether `mask` contains `usage`.

Callers 15

mlDsaGenerateKeyFunction · 0.85
mlDsaImportKeyFunction · 0.85
validateKeyOpsFunction · 0.85
mlKemGenerateKeyFunction · 0.85
mlKemImportKeyFunction · 0.85
c20pGenerateKeyFunction · 0.85
c20pImportKeyFunction · 0.85
ecGenerateKeyFunction · 0.85
ecImportKeyFunction · 0.85
cfrgGenerateKeyFunction · 0.85
cfrgImportKeyFunction · 0.85
hmacGenerateKeyFunction · 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…