[−][src]Trait bitcoin_hashes::Hash
Trait which applies to hashes of all types
Associated Types
type Engine: HashEngine
A hashing engine which bytes can be serialized into. It is expected
to implement the io::Write
trait, and to never return errors under
any conditions.
type Inner: FromHex
The byte array that represents the hash internally
Associated Constants
const LEN: usize
Length of the hash, in bytes
const DISPLAY_BACKWARD: bool
Flag indicating whether user-visible serializations of this hash
should be backward. For some reason Satoshi decided this should be
true for Sha256dHash
, so here we are.
Required methods
fn from_engine(e: Self::Engine) -> Self
Produce a hash from the current state of a given engine
fn from_slice(sl: &[u8]) -> Result<Self, Error>
Copies a byte slice into a hash object
fn into_inner(self) -> Self::Inner
Unwraps the hash and returns the underlying byte array
fn from_inner(inner: Self::Inner) -> Self
Constructs a hash from the underlying byte array