oa::cryptography::Hash

A fixed 32-byte SHAKE-256 digest.

StRust public API

Declaration

pub struct Hash(/* private fields */);
Public Rust declaration.

Public Methods

pub const fn as_bytes(&self) -> &[u8; 32]
pub fn is_zero(&self) -> bool
pub fn to_hex(self) -> String
pub fn to_short_hex(self) -> String
fn clone(&self) -> Hash
fn fmt(&self, f: &mut Formatter<'_>) -> Result
fn hash<__H: Hasher>(&self, state: &mut __H)
fn cmp(&self, other: &Hash) -> Ordering
fn eq(&self, other: &Hash) -> bool
fn partial_cmp(&self, other: &Hash) -> Option<Ordering>

Associated Functions

pub const fn zero() -> Self
pub fn from_bytes(bytes: &[u8]) -> Result<Self>
pub fn from_hex(hex: &str) -> Result<Self>
fn default() -> Hash

Public Method Documentation

pub const fn as_bytes( &self ) -> &[u8; 32]
No public source comment is attached to this declaration.
pub fn is_zero( &self ) -> bool
No public source comment is attached to this declaration.
pub fn to_hex( self ) -> String
No public source comment is attached to this declaration.
pub fn to_short_hex( self ) -> String
No public source comment is attached to this declaration.
fn clone( &self ) -> Hash
No public source comment is attached to this declaration.
fn fmt( &self, f: &mut Formatter<'_> ) -> Result
No public source comment is attached to this declaration.
fn hash<__H: Hasher>( &self, state: &mut __H )
No public source comment is attached to this declaration.
fn cmp( &self, other: &Hash ) -> Ordering
No public source comment is attached to this declaration.
fn eq( &self, other: &Hash ) -> bool
No public source comment is attached to this declaration.
fn partial_cmp( &self, other: &Hash ) -> Option<Ordering>
No public source comment is attached to this declaration.
pub const fn zero() -> Self
No public source comment is attached to this declaration.
pub fn from_bytes( bytes: &[u8] ) -> Result<Self>
No public source comment is attached to this declaration.
pub fn from_hex( hex: &str ) -> Result<Self>
No public source comment is attached to this declaration.
fn default() -> Hash
No public source comment is attached to this declaration.