Isomorphic Bitmessage crypto module. Reexports platform-dependent implementations and and also some common routines.
Methods
(static) getPrivate() → {Buffer}
Generate new random private key.
Returns:
New private key.
- Type
- Buffer
(static) getPublic(privateKey) → {Buffer}
Generate public key for a given private key.
Parameters:
Name | Type | Description |
---|---|---|
privateKey |
Buffer | Private key |
Returns:
Public key.
- Type
- Buffer
(static) randomBytes(size) → {Buffer}
Generate cryptographically strong pseudo-random data.
Parameters:
Name | Type | Description |
---|---|---|
size |
number | Number of bytes |
Returns:
Buffer with random data.
- Type
- Buffer
(static) ripemd160(buf) → {Buffer}
Calculate RIPEMD-160 hash.
Parameters:
Name | Type | Description |
---|---|---|
buf |
Buffer | Input data |
Returns:
Resulting hash.
- Type
- Buffer
(static) sha256(buf) → {Buffer}
Calculate SHA-256 hash.
Parameters:
Name | Type | Description |
---|---|---|
buf |
Buffer | Input data |
Returns:
Resulting hash.
- Type
- Buffer
(static) sha512(buf) → {Buffer}
Calculate SHA-512 hash.
Parameters:
Name | Type | Description |
---|---|---|
buf |
Buffer | Input data |
Returns:
Resulting hash.
- Type
- Buffer