UNPKG

1.07 kBTypeScriptView Raw
1/**
2 * Generates completely random bytes using native implementations. The `byteCount` property
3 * is a `number` indicating the number of bytes to generate in the form of a `Uint8Array`.
4 * Falls back to `Math.random` during development to prevent issues with React Native Debugger.
5 * @param byteCount - A number within the range from `0` to `1024`. Anything else will throw a `TypeError`.
6 * @return An array of random bytes with the same length as the `byteCount`.
7 */
8export declare function getRandomBytes(byteCount: number): Uint8Array;
9/**
10 * Generates completely random bytes using native implementations. The `byteCount` property
11 * is a `number` indicating the number of bytes to generate in the form of a `Uint8Array`.
12 * @param byteCount - A number within the range from `0` to `1024`. Anything else will throw a `TypeError`.
13 * @return A promise that fulfills with an array of random bytes with the same length as the `byteCount`.
14 */
15export declare function getRandomBytesAsync(byteCount: number): Promise<Uint8Array>;
16//# sourceMappingURL=Random.d.ts.map
\No newline at end of file