Class: Sha256
Class to help with Sha256 scheme. TypeScript conversion from https://github.com/emn178/js-sha256.
Table of contents
Properties
Constructors
Methods
Properties
SIZE_256
▪ Static
Readonly
SIZE_256: number
= 256
Sha256 256.
SIZE_224
▪ Static
Readonly
SIZE_224: number
= 224
Sha256 224.
Constructors
constructor
• new Sha256(bits?
)
Create a new instance of Sha256.
Parameters
Name | Type | Default value | Description |
---|---|---|---|
bits | number | Sha256.SIZE_256 | The number of bits. |
Methods
sum256
▸ Static
sum256(data
): Uint8Array
Perform Sum 256 on the data.
Parameters
Name | Type | Description |
---|---|---|
data | Uint8Array | The data to operate on. |
Returns
Uint8Array
The sum 256 of the data.
sum224
▸ Static
sum224(data
): Uint8Array
Perform Sum 224 on the data.
Parameters
Name | Type | Description |
---|---|---|
data | Uint8Array | The data to operate on. |
Returns
Uint8Array
The sum 224 of the data.
update
▸ update(message
): Sha256
Update the hash with the data.
Parameters
Name | Type | Description |
---|---|---|
message | Uint8Array | The data to update the hash with. |
Returns
The instance for chaining.
digest
▸ digest(): Uint8Array
Get the digest.
Returns
Uint8Array
The digest.