summaryrefslogtreecommitdiffhomepage
path: root/packages/server/src/helpers/iso/isoCrypto/getRandomValues.ts
blob: ab7454b7c910c154566fae350e04bbe38685b9d1 (plain)
1
2
3
4
5
6
7
8
9
10
11
import WebCrypto from '@simplewebauthn/iso-webcrypto';

/**
 * Fill up the provided bytes array with random bytes equal to its length.
 *
 * @returns the same bytes array passed into the method
 */
export function getRandomValues(array: Uint8Array): Uint8Array {
  WebCrypto.getRandomValues(array);
  return array;
}