(crypto: Crypto, size: number)
| 258 | |
| 259 | // `getRandomValues` throws a `QuotaExceededError` above 65,536 bytes. |
| 260 | const fillRandom = (crypto: Crypto, size: number): Uint8Array => { |
| 261 | const bytes = new Uint8Array(size) |
| 262 | for (let offset = 0; offset < size; offset += 65_536) { |
| 263 | crypto.getRandomValues(bytes.subarray(offset, offset + 65_536)) |
| 264 | } |
| 265 | return bytes |
| 266 | } |
| 267 | |
| 268 | /** |
| 269 | * Layer that provides `SecureRandom` from `getRandomValues` on the `WebCrypto` |
no outgoing calls
no test coverage detected