Namespace: md5

md5

Version:
  • 0.4.0
Author:
  • Chen, Yi-Cyuan [emn178@gmail.com]
License:
  • MIT
Source:

Methods

(static) array(message) → {Array}

Output hash as bytes array
Parameters:
Name Type Description
message String | Array | Uint8Array | ArrayBuffer message to hash
Source:
Returns:
Bytes array
Type
Array
Example
md5.array('The quick brown fox jumps over the lazy dog');

(static) arrayBuffer(message) → {ArrayBuffer}

Output hash as ArrayBuffer
Parameters:
Name Type Description
message String | Array | Uint8Array | ArrayBuffer message to hash
Source:
Returns:
ArrayBuffer
Type
ArrayBuffer
Example
md5.arrayBuffer('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
Deprecated:
  • This maybe confuse with Buffer in node.js. Please use arrayBuffer instead.
Source:
Returns:
ArrayBuffer
Type
ArrayBuffer
Example
md5.buffer('The quick brown fox jumps over the lazy dog');

(static) create() → {Md5}

Create Md5 object
Source:
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
Source:
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
Source:
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
Source:
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');