You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Returns a cryptographically strong pseudo-random data string. Takes a size argument for the length of the string.
6
9
7
-
### `randomAlphanumString(<Number> size)`
10
+
### `randomAlphanumString(size: number): string`
11
+
8
12
Returns a cryptographically strong pseudo-random alphanumeric data string. Takes a size argument for the length of the string.
9
13
10
-
### `randomDigits(<Number> size)`
11
-
Returns a cryptographically strong pseudo-random data string consisting of only numerical digits (0-9). Takes a size argument for the length of the string.
14
+
### `randomDigits(size: number): string`
15
+
16
+
Returns a cryptographically strong pseudo-random data string consisting of only numerical digits (0-9). Takes a size argument for the length of the string.
17
+
18
+
### `randomBits(bits: number): Buffer`
19
+
20
+
Returns a Buffer of cryptographically strong pseudo-random bits. Takes a bits argument for the number of bits to generate.
Performs a constant-time comparison of two strings to prevent timing attacks. Returns `true` if the strings are equal, `false` otherwise. Safe to use with strings of different lengths.
0 commit comments