[][src]Struct dumb_crypto::sha256::SHA256

pub struct SHA256 { /* fields omitted */ }

Main digest structure.

Usage:

extern crate dumb_crypto;

use::dumb_crypto::sha256::SHA256;

let mut sha256 = SHA256::new();

sha256.update(b"hello world");
assert_eq!(sha256.digest().to_vec(), vec![
    0xb9, 0x4d, 0x27, 0xb9, 0x93, 0x4d, 0x3e, 0x08,
    0xa5, 0x2e, 0x52, 0xd7, 0xda, 0x7d, 0xab, 0xfa,
    0xc4, 0x84, 0xef, 0xe3, 0x7a, 0x53, 0x80, 0xee,
    0x90, 0x88, 0xf7, 0xac, 0xe2, 0xef, 0xcd, 0xe9,
]);

Methods

impl SHA256
[src]

pub fn new() -> SHA256
[src]

Create new instance of SHA256 digest.

pub fn update(self: &mut SHA256, data: &[u8])
[src]

Add input data to the digest.

pub fn digest(self: &mut SHA256) -> [u8; 32]
[src]

Generate digest array.

Trait Implementations

impl Default for SHA256
[src]

Auto Trait Implementations

impl Send for SHA256

impl Sync for SHA256

Blanket Implementations

impl<T> From for T
[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom for T where
    T: From<U>, 
[src]

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Any for T where
    T: 'static + ?Sized
[src]