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
Sets the pseudo random number generator to use as a fallback if neither Node's [crypto](http://nodejs.org/api/crypto.html) module nor the [Web Crypto API](http://www.w3.org/TR/WebCryptoAPI/) is available. Please note: It is highly important that the PRNG used is cryptographically secure and that it is seeded properly!
Asynchronously generates a hash for the given string. Optionally calls a progress callback with the percentage of rounds completed (0.0 - 1.0), maximally once per `MAX_EXECUTION_TIME = 100` ms.
155
+
Asynchronously generates a hash for the given string.
Asynchronously compares a string against a hash. Optionally calls a progress callback with the percentage of rounds completed (0.0 - 1.0), maximally once per `MAX_EXECUTION_TIME = 100` ms.
Sets the pseudo random number generator to use as a fallback if neither [Web Crypto API](http://www.w3.org/TR/WebCryptoAPI/) nor Node.js [crypto](http://nodejs.org/api/crypto.html) are available. Please note: It is highly important that the PRNG used is cryptographically secure and that it is seeded properly!
/** Called with the percentage of rounds completed (0.0 - 1.0), maximally once per `MAX_EXECUTION_TIME = 100` ms. */
7
+
typeProgressCallback=(percentage: number)=>void;
8
+
/** Called to obtain random bytes when both Web Crypto API and Node.js crypto are not available. */
9
+
typeRandomFallback=(length: number)=>number[];
26
10
27
11
/**
28
12
* Sets the pseudo random number generator to use as a fallback if neither node's crypto module nor the Web Crypto API is available.
29
13
* Please note: It is highly important that the PRNG used is cryptographically secure and that it is seeded properly!
30
14
* @param random Function taking the number of bytes to generate as its sole argument, returning the corresponding array of cryptographically secure random byte values.
0 commit comments