Skip to content
This repository has been archived by the owner on Jun 17, 2021. It is now read-only.

Latest commit

 

History

History
243 lines (143 loc) · 5.65 KB

_hash_.md

File metadata and controls

243 lines (143 loc) · 5.65 KB

ethereumjs-util"hash"

Module: "hash"

Index

Functions

Functions

Const keccak

keccak(a: Buffer, bits: number): Buffer

Defined in hash.ts:13

Creates Keccak hash of a Buffer input

Parameters:

Name Type Default Description
a Buffer - The input data (Buffer)
bits number 256 (number = 256) The Keccak width

Returns: Buffer


Const keccak256

keccak256(a: Buffer): Buffer

Defined in hash.ts:38

Creates Keccak-256 hash of the input, alias for keccak(a, 256).

Parameters:

Name Type Description
a Buffer The input data (Buffer)

Returns: Buffer


Const keccakFromArray

keccakFromArray(a: number[], bits: number): Buffer‹›

Defined in hash.ts:68

Creates Keccak hash of a number array input

Parameters:

Name Type Default Description
a number[] - The input data (number[])
bits number 256 (number = 256) The Keccak width

Returns: Buffer‹›


Const keccakFromHexString

keccakFromHexString(a: string, bits: number): Buffer‹›

Defined in hash.ts:58

Creates Keccak hash of an 0x-prefixed string input

Parameters:

Name Type Default Description
a string - The input data (String)
bits number 256 (number = 256) The Keccak width

Returns: Buffer‹›


Const keccakFromString

keccakFromString(a: string, bits: number): Buffer‹›

Defined in hash.ts:47

Creates Keccak hash of a utf-8 string input

Parameters:

Name Type Default Description
a string - The input data (String)
bits number 256 (number = 256) The Keccak width

Returns: Buffer‹›


Const ripemd160

ripemd160(a: Buffer, padded: boolean): Buffer

Defined in hash.ts:116

Creates RIPEMD160 hash of a Buffer input.

Parameters:

Name Type Description
a Buffer The input data (Buffer)
padded boolean Whether it should be padded to 256 bits or not

Returns: Buffer


Const ripemd160FromArray

ripemd160FromArray(a: number[], padded: boolean): Buffer

Defined in hash.ts:136

Creates RIPEMD160 hash of a number[] input.

Parameters:

Name Type Description
a number[] The input data (number[])
padded boolean Whether it should be padded to 256 bits or not

Returns: Buffer


Const ripemd160FromString

ripemd160FromString(a: string, padded: boolean): Buffer

Defined in hash.ts:126

Creates RIPEMD160 hash of a string input.

Parameters:

Name Type Description
a string The input data (String)
padded boolean Whether it should be padded to 256 bits or not

Returns: Buffer


Const rlphash

rlphash(a: rlp.Input): Buffer

Defined in hash.ts:162

Creates SHA-3 hash of the RLP encoded version of the input.

Parameters:

Name Type Description
a rlp.Input The input data

Returns: Buffer


Const sha256

sha256(a: Buffer): Buffer

Defined in hash.ts:77

Creates SHA256 hash of a Buffer input.

Parameters:

Name Type Description
a Buffer The input data (Buffer)

Returns: Buffer


Const sha256FromArray

sha256FromArray(a: number[]): Buffer

Defined in hash.ts:95

Creates SHA256 hash of a number[] input.

Parameters:

Name Type Description
a number[] The input data (number[])

Returns: Buffer


Const sha256FromString

sha256FromString(a: string): Buffer

Defined in hash.ts:86

Creates SHA256 hash of a string input.

Parameters:

Name Type Description
a string The input data (string)

Returns: Buffer