Module: bitmessage/crypto

Isomorphic Bitmessage crypto module. Reexports platform-dependent implementations and and also some common routines.

Source:

Methods

(static) getPrivate() → {Buffer}

Generate new random private key.

Source:
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

Source:
Returns:

Public key.

Type
Buffer

(static) randomBytes(size) → {Buffer}

Generate cryptographically strong pseudo-random data.

Parameters:
Name Type Description
size number

Number of bytes

Source:
Returns:

Buffer with random data.

Type
Buffer

(static) ripemd160(buf) → {Buffer}

Calculate RIPEMD-160 hash.

Parameters:
Name Type Description
buf Buffer

Input data

Source:
Returns:

Resulting hash.

Type
Buffer

(static) sha256(buf) → {Buffer}

Calculate SHA-256 hash.

Parameters:
Name Type Description
buf Buffer

Input data

Source:
Returns:

Resulting hash.

Type
Buffer

(static) sha512(buf) → {Buffer}

Calculate SHA-512 hash.

Parameters:
Name Type Description
buf Buffer

Input data

Source:
Returns:

Resulting hash.

Type
Buffer