Sha256 class final

SHA-256 (FIPS 180-4) as an incremental hash.

Used by the 7z AES key derivation (iterated SHA-256) and RAR5 (PBKDF2-HMAC-SHA256, hash-key checksum tweaking). All arithmetic stays within unsigned 32-bit range (dart2js-exact).

Inheritance

Constructors

Sha256()
Creates a SHA-256 hash in its initial state.

Properties

digestSize → int
Digest length in bytes (20 for SHA-1, 32 for SHA-256).
no setteroverride
hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

add(Uint8List chunk, [int start = 0, int? end]) → void
Updates the hash with chunk[start..end).
inherited
compress(Uint8List block, int offset) → void
Compresses the 64 bytes at block[offset..offset+64) into the state.
override
copy() → Sha256
Returns an independent copy of the running state.
override
finish() → Uint8List
Pads, compresses the final block(s), and returns the digest. The hash cannot be updated afterwards; snapshot with copy first to continue a running stream.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited
writeDigest(Uint8List out) → void
Writes the state words to out big-endian.
override

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Methods

compute(Uint8List data) → Uint8List
Computes the SHA-256 digest of data in one call.