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

Function generateCryptoKey

test/parallel/test-assert-partial-deep-equal.js:21–38  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

19}
20
21async function generateCryptoKey() {
22 const { KeyObject } = require('node:crypto');
23 const { subtle } = globalThis.crypto;
24
25 const cryptoKey = await subtle.generateKey(
26 {
27 name: 'HMAC',
28 hash: 'SHA-256',
29 length: 256,
30 },
31 true,
32 ['sign', 'verify']
33 );
34
35 const keyObject = KeyObject.from(cryptoKey);
36
37 return { cryptoKey, keyObject };
38}
39
40describe('Object Comparison Tests', () => {
41 describe('partialDeepStrictEqual', () => {

Calls 2

requireFunction · 0.50
fromMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…