Algorithm Property
The algorithm used to create the hash.
Syntax
hash.getAlgorithm([callback]) hash.setAlgorithm( algorithm, [callback])
Possible Values
0 (haSHA1), 1 (haSHA224), 2 (haSHA256), 3 (haSHA384), 4 (haSHA512), 5 (haMD2), 6 (haMD4), 7 (haMD5), 8 (haRIPEMD160), 9 (haMD5SHA1), 10 (haHMACMD5), 11 (haHMACSHA1), 12 (haHMACSHA224), 13 (haHMACSHA256), 14 (haHMACSHA384), 15 (haHMACSHA512), 16 (haHMACRIPEMD160), 17 (haSHA3_224), 18 (haSHA3_256), 19 (haSHA3_384), 20 (haSHA3_512)
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 when calling ComputeHash. Possible values are:
0 (haSHA1 - default) | SHA1 |
1 (haSHA224) | SHA-224 |
2 (haSHA256) | SHA-256 |
3 (haSHA384) | SHA-384 |
4 (haSHA512) | SHA-512 |
5 (haMD2) | MD2 |
6 (haMD4) | MD4 |
7 (haMD5) | MD5 |
8 (haRIPEMD160) | RIPEMD-160 |
9 (haMD5SHA1) | MD5SHA1 |
10 (haHMACMD5) | HMAC-MD5 |
11 (haHMACSHA1) | HMAC-SHA1 |
12 (haHMACSHA224) | HMAC-SHA224 |
13 (haHMACSHA256) | HMAC-SHA256 |
14 (haHMACSHA384) | HMAC-SHA384 |
15 (haHMACSHA512) | HMAC-SHA512 |
16 (haHMACRIPEMD160) | HMAC-RIPEMD-160 |
17 (haSHA3_224) | SHA-3-224 (originally known as Keccak) |
18 (haSHA3_256) | SHA-3-256 (originally known as Keccak) |
19 (haSHA3_384) | SHA-3-384 (originally known as Keccak) |
20 (haSHA3_512) | SHA-3-512 (originally known as Keccak) |
Data Type
Integer