crypt.Sha256 Extends goog.crypt.Sha2
SHA-256 cryptographic hash constructor.

Inheritance

Constructor

goog.crypt.Sha256()

Instance Methods

Public Protected Private
computeChunk_()
Helper function to compute the hashes for a given 512-bit message chunk.
code »
digest()
No description.
code »
reset()
No description.
code »
update()
No description.
code »
digest() !Array.<number>
No description.
Returns: !Array.<number>  The finalized hash computed from the internal accumulator.
code »
update(bytesopt_length)
Adds a byte array (array with values in [0-255] range) or a string (might only contain 8-bit, i.e., Latin1 characters) to the internal accumulator. Many hash functions operate on blocks of data and implement optimizations when a full chunk of data is readily available. Hence it is often preferable to provide large chunks of data (a kilobyte or more) than to repeatedly call the update method with few tens of bytes. If this is not possible, or not feasible, it might be good to provide data in multiplies of hash block size (often 64 bytes). Please see the implementation and performance tests of your favourite hash.
Arguments:
bytes : Array.<number> | Uint8Array | string
Data used for the update.
opt_length : number=
Number of bytes to use.
code »

Instance Properties

constructor :
No description.
Code »
chunk_ :
A chunk holding the currently processed message bytes. Once the chunk has 64 bytes, we feed it into computeChunk_ function and reset this.chunk_.
Code »
constructor :
No description.
Code »
hash_ :
Holds the previous values of accumulated hash a-h in the computeChunk_ function.
Code »
inChunk_ :
Current number of bytes in this.chunk_.
Code »
initHashBlocks_ :
No description.
Code »
numHashBlocks_ :
The number of output hash blocks (each block is 4 bytes long).
Code »
total_ :
Total number of bytes in currently processed message.
Code »
w_ :
Temporary array used in chunk computation. Allocate here as a member rather than as a local within computeChunk_() as a performance optimization to reduce the number of allocations and reduce garbage collection.
Code »
blockSize :
The block size for the hasher.
Code »
reset :
Resets the internal accumulator.
Code »

Static Properties

goog.crypt.Sha256.INIT_HASH_BLOCK_ :
No description.
Code »
goog.crypt.Sha256.superClass_ :
No description.
Code »

Package crypt

Package Reference