[][src]Crate bitcoin_hashes

Rust Hashes Library

This is a simple, no-dependency library which implements the hash functions needed by Bitcoin. These are SHA256, SHA256d, and RIPEMD160. As an ancillary thing, it exposes hexadecimal serialization and deserialization, since these are needed to display hashes anway.

Re-exports

pub extern crate core;
pub use hmac::Hmac;
pub use hmac::HmacEngine;
pub use error::Error;

Modules

cmp

Useful comparison functions.

error

Error Type

hash160

HASH160 (SHA256 then RIPEMD160)

hex

Hex encoding and decoding

hmac

HMAC support

ripemd160

RIPEMD160

serde_macros

Macros for serde trait impls, and supporting code

sha1

SHA1

sha256

SHA256

sha256d

SHA256d

sha256t

SHA256t (tagged SHA256)

sha512

SHA512

siphash24

SipHash 2-4

Macros

borrow_slice_impl

Adds slicing traits implementations to a given type $ty

hash_newtype

Create a new newtype around a [Hash] type.

hex_fmt_impl

Adds hexadecimal formatting implementation of a trait $imp to a given type $ty

index_impl

Adds core::ops::Index trait implementation to a given type $ty

serde_impl

Does an "empty" serde implementation for the configuration without serde feature

sha256t_hash_newtype

Macro used to define a newtype tagged hash. It creates two public types:

Traits

Hash

Trait which applies to hashes of all types

HashEngine

A hashing engine which bytes can be serialized into