Algorithm Property
The random number algorithm.
Syntax
ezrand.getAlgorithm([callback]) ezrand.setAlgorithm( algorithm, [callback])
Possible Values
0 (raISAAC), 1 (raMSCryptoAPI), 2 (raPlatform), 3 (raSecurePlatform), 4 (raRC4Random)
Default Value
0
Callback
The 'callback' parameter specifies a function which will be called when the operation completes (or an error is encountered). If the 'callback' parameter is not specified, then the method will block and will not return until the operation completes (or an error is encountered).
The callback for the getAlgorithm([callback]) method is defined as:
function(err, data){ }
'err' is the error that occurred. If there was no error, then 'err' is 'null'.
'data' is the value returned by the method.
The callback for the setAlgorithm([callback]) method is defined as:
function(err){ }
'err' is the error that occurred. If there was no error, then 'err' is 'null'.
'err' has 2 properties which hold detailed information:
err.code err.message
Remarks
This property specifies the algorithm used to generate the random number or bytes. Possible values are:
0 (raISAAC) | ISAAC (indirection, shift, accumulate, add, and count) |
1 (raMSCryptoAPI) | The Microsoft Crypto API. This is only available on Windows. |
2 (raPlatform) | The platform's random implementation. |
3 (raSecurePlatform) | The platform's secure random implementation. This is only applicable in .NET and Java. In .NET the class uses the "RNGCryptoServiceProvider" class. In Java the class uses the "SecureRandom" class. |
4 (raRC4Random) | RC4 based random implementation. |
Data Type
Integer