()
| 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] |