Struct stacks_common::deps_common::bitcoin::util::hash::Sha256dHash
source · pub struct Sha256dHash(pub [u8; 32]);
Expand description
A Bitcoin hash, 32-bytes, computed from x as SHA256(SHA256(x))
Tuple Fields§
§0: [u8; 32]
Implementations§
source§impl Sha256dHash
impl Sha256dHash
source§impl Sha256dHash
impl Sha256dHash
sourcepub fn from_data(data: &[u8]) -> Sha256dHash
pub fn from_data(data: &[u8]) -> Sha256dHash
Create a hash by hashing some data
sourcepub fn from_hex(s: &str) -> Result<Sha256dHash, HexError>
pub fn from_hex(s: &str) -> Result<Sha256dHash, HexError>
Decodes a big-endian (i.e. reversed vs sha256sum output) hex string as a Sha256dHash
sourcepub fn from_hex_le(s: &str) -> Result<Sha256dHash, HexError>
pub fn from_hex_le(s: &str) -> Result<Sha256dHash, HexError>
Decodes a little-endian (i.e. same as sha256sum output) hex string as a Sha256dHash
sourcepub fn le_hex_string(&self) -> String
pub fn le_hex_string(&self) -> String
Human-readable hex output
sourcepub fn be_hex_string(&self) -> String
pub fn be_hex_string(&self) -> String
Human-readable hex output
Trait Implementations§
source§impl Clone for Sha256dHash
impl Clone for Sha256dHash
source§fn clone(&self) -> Sha256dHash
fn clone(&self) -> Sha256dHash
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<D: SimpleDecoder> ConsensusDecodable<D> for Sha256dHash
impl<D: SimpleDecoder> ConsensusDecodable<D> for Sha256dHash
source§fn consensus_decode(d: &mut D) -> Result<Sha256dHash, Error>
fn consensus_decode(d: &mut D) -> Result<Sha256dHash, Error>
Decode an object with a well-defined format
source§impl<S: SimpleEncoder> ConsensusEncodable<S> for Sha256dHash
impl<S: SimpleEncoder> ConsensusEncodable<S> for Sha256dHash
source§impl Debug for Sha256dHash
impl Debug for Sha256dHash
source§impl Default for Sha256dHash
impl Default for Sha256dHash
source§fn default() -> Sha256dHash
fn default() -> Sha256dHash
Returns the “default value” for a type. Read more
source§impl Display for Sha256dHash
impl Display for Sha256dHash
source§impl<'a> From<&'a [u8]> for Sha256dHash
impl<'a> From<&'a [u8]> for Sha256dHash
source§fn from(data: &'a [u8]) -> Sha256dHash
fn from(data: &'a [u8]) -> Sha256dHash
Converts to this type from the input type.
source§impl FromSql for Sha256dHash
impl FromSql for Sha256dHash
source§fn column_result(value: ValueRef<'_>) -> FromSqlResult<Sha256dHash>
fn column_result(value: ValueRef<'_>) -> FromSqlResult<Sha256dHash>
Converts SQLite value into Rust value.
source§impl Hash for Sha256dHash
impl Hash for Sha256dHash
source§impl Index<RangeFull> for Sha256dHash
impl Index<RangeFull> for Sha256dHash
source§impl Index<usize> for Sha256dHash
impl Index<usize> for Sha256dHash
source§impl LowerHex for Sha256dHash
impl LowerHex for Sha256dHash
source§impl Ord for Sha256dHash
impl Ord for Sha256dHash
source§fn cmp(&self, other: &Sha256dHash) -> Ordering
fn cmp(&self, other: &Sha256dHash) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl PartialEq<Sha256dHash> for Sha256dHash
impl PartialEq<Sha256dHash> for Sha256dHash
source§fn eq(&self, other: &Sha256dHash) -> bool
fn eq(&self, other: &Sha256dHash) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd<Sha256dHash> for Sha256dHash
impl PartialOrd<Sha256dHash> for Sha256dHash
source§fn partial_cmp(&self, other: &Sha256dHash) -> Option<Ordering>
fn partial_cmp(&self, other: &Sha256dHash) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresource§impl ToSql for Sha256dHash
impl ToSql for Sha256dHash
source§fn to_sql(&self) -> Result<ToSqlOutput<'_>>
fn to_sql(&self) -> Result<ToSqlOutput<'_>>
Converts Rust value to SQLite value
source§impl UpperHex for Sha256dHash
impl UpperHex for Sha256dHash
impl Copy for Sha256dHash
impl Eq for Sha256dHash
Auto Trait Implementations§
impl RefUnwindSafe for Sha256dHash
impl Send for Sha256dHash
impl Sync for Sha256dHash
impl Unpin for Sha256dHash
impl UnwindSafe for Sha256dHash
Blanket Implementations§
§impl<T> InitializableFromZeroed for Twhere
T: Default,
impl<T> InitializableFromZeroed for Twhere T: Default,
§unsafe fn initialize(place: *mut T)
unsafe fn initialize(place: *mut T)
Called to initialize a place to a valid value, after it is set
to all-bits-zero. Read more