MCPcopy Create free account
hub / github.com/GoogleCloudPlatform/nodejs-docs-samples / generateRandomBytes

Function generateRandomBytes

kms/generateRandomBytes.js:39–48  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

37 const locationName = client.locationPath(projectId, locationId);
38
39 async function generateRandomBytes() {
40 const [randomBytesResponse] = await client.generateRandomBytes({
41 location: locationName,
42 lengthBytes: numBytes,
43 protectionLevel: 'HSM',
44 });
45
46 console.log(`Random bytes: ${randomBytesResponse.data.toString('base64')}`);
47 return randomBytesResponse;
48 }
49
50 return generateRandomBytes();
51 // [END kms_generate_random_bytes]

Callers 1

mainFunction · 0.85

Calls 1

toStringMethod · 0.80

Tested by

no test coverage detected