Members
(static) asciiThreshold :Number
To use node.js md5 if ascii string length is greater than this value.
Type:
- Number
(static) bytesThreshold :Number
To use node.js md5 if bytes length is greater than this value.
Type:
- Number
(static) utf8Threshold :Number
To use node.js md5 if UTF-8 string length is greater than this value.
Type:
- Number
Methods
(static) array(message) → {Array}
Output hash as bytes array
Parameters:
Name | Type | Description |
---|---|---|
message |
String | Array | Uint8Array | ArrayBuffer | message to hash |
Returns:
Bytes array
- Type
- Array
Example
md5.array('The quick brown fox jumps over the lazy dog');
(static) buffer(message) → {ArrayBuffer}
Output hash as ArrayBuffer
Parameters:
Name | Type | Description |
---|---|---|
message |
String | Array | Uint8Array | ArrayBuffer | message to hash |
Returns:
ArrayBuffer
- Type
- ArrayBuffer
Example
md5.buffer('The quick brown fox jumps over the lazy dog');
(static) create() → {Md5}
Create Md5 object
Returns:
Md5 object.
- Type
- Md5
Example
var hash = md5.create();
(static) digest(message) → {Array}
Output hash as bytes array
Parameters:
Name | Type | Description |
---|---|---|
message |
String | Array | Uint8Array | ArrayBuffer | message to hash |
Returns:
Bytes array
- Type
- Array
Example
md5.digest('The quick brown fox jumps over the lazy dog');
(static) hex(message) → {String}
Output hash as hex string
Parameters:
Name | Type | Description |
---|---|---|
message |
String | Array | Uint8Array | ArrayBuffer | message to hash |
Returns:
Hex string
- Type
- String
Example
md5.hex('The quick brown fox jumps over the lazy dog');
// equal to
md5('The quick brown fox jumps over the lazy dog');
(static) update(message) → {Md5}
Create and update Md5 object
Parameters:
Name | Type | Description |
---|---|---|
message |
String | Array | Uint8Array | ArrayBuffer | message to hash |
Returns:
Md5 object.
- Type
- Md5
Example
var hash = md5.update('The quick brown fox jumps over the lazy dog');
// equal to
var hash = md5.create();
hash.update('The quick brown fox jumps over the lazy dog');