pub fn hash(&mut self, data: &[u8]) -> Result<()> {
        unsafe {
            Error::check(BCryptHashData(
                self.handle.as_ptr(),
                data.as_ptr() as PUCHAR,
                data.len() as ULONG,
                0,
            ))
        }
    }
/// Perform a one way hash on the data
///
/// This method can be called multiple times. To get the final result, use [`finish`].
///
/// # Examples
///
/// ```
/// # use win_crypto_ng::hash::{HashAlgorithm, HashAlgorithmId};
/// let algo = HashAlgorithm::open(HashAlgorithmId::Sha256).unwrap();
/// let mut hash = algo.new_hash().unwrap();
/// hash.hash("Some data".as_bytes()).unwrap();
/// hash.hash("Some more data".as_bytes()).unwrap();
/// ```
///
/// [`finish`]: #method.finish
Perform a one way hash on the data
This method can be called multiple times. To get the final result, use [`finish`].
Perform a one way hash on the data This method can be called multiple times . To get the final result use [ ` finish ` ] .
pub fn hash(&mut self, data: &[u8]) -> Result<()> {
        unsafe {
            Error::check(BCryptHashData(
                self.handle.as_ptr(),
                data.as_ptr() as PUCHAR,
                data.len() as ULONG,
                0,
            ))
        }
    }
pub fn hash ( & mut self , data : & [ u8 ] ) -> Result < ( ) > { unsafe { Error :: check ( BCryptHashData ( self . handle . as_ptr ( ) , data . as_ptr ( ) as PUCHAR , data . len ( ) as ULONG , 0 , ) ) } }
Perform a one way hash on the data
This method can be called multiple times.
Perform a one way hash on the data This method can be called multiple times .
&mut self
data
&[u8]
&mut self
data
&[u8]
examples
None
use win_crypto_ng::hash::{hashalgorithm, hashalgorithmid};
let algo = HashAlgorithm::open(HashAlgorithmId::Sha256).unwrap();
let mut hash = algo.new_hash().unwrap();
hash.hash("Some data".as_bytes()).unwrap();
hash.hash("Some more data".as_bytes()).unwrap();
```

[`finish`]: #method.finish
let algo = HashAlgorithm :: open ( HashAlgorithmId :: Sha256 ) . unwrap () ; let mut hash = algo . new_hash () . unwrap () ; hash . hash ( " Some data " . as_bytes () ) . unwrap () ; hash . hash ( " Some more data " . as_bytes () ) . unwrap () ; ` ` ` [ ` finish ` ] : #method . finish