Hash class

Hash represents a Bitcoin hash (typically double SHA256)

Constructors

Hash.fromBytes(Uint8List bytes)
Create hash from byte array with validation
factory
Hash.fromHex(String hexString)
Create hash from hex string
factory
Hash.fromJson(Map<String, dynamic> json)
JSON deserialization
factory
Hash.zero()
Create zero hash
factory

Properties

bytes Uint8List
Get raw bytes (not reversed)
no setter
hashCode int
The hash code for this object.
no setteroverride
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

cloneBytes() Uint8List
Get copy of bytes
isEqual(Hash? other) bool
Check if equal to another hash
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
setBytes(Uint8List newHash) → void
Set bytes from array
toJson() Map<String, dynamic>
JSON serialization
toString() String
Get hash as hex string (byte-reversed for display)
override

Operators

operator ==(Object other) bool
The equality operator.
override