pub fn new_hash(&self) -> Result<Hash> {
        let object_size = self.handle.get_property::<DWORD>(BCRYPT_OBJECT_LENGTH)? as usize;

        let mut hash_handle = HashHandle::new();
        let mut object = Buffer::new(object_size);
        unsafe {
            Error::check(BCryptCreateHash(
                self.handle.as_ptr(),
                hash_handle.as_mut_ptr(),
                object.as_mut_ptr(),
                object.len() as ULONG,
                null_mut(),
                0,
                0,
            ))
            .map(|_| Hash {
                handle: hash_handle,
                _object: object,
            })
        }
    }
/// Creates a new hash from the algorithm
Creates a new hash from the algorithm
Creates a new hash from the algorithm
pub fn new_hash(&self) -> Result<Hash> {
        let object_size = self.handle.get_property::<DWORD>(BCRYPT_OBJECT_LENGTH)? as usize;
        let mut hash_handle = HashHandle::new();
        let mut object = Buffer::new(object_size);
        unsafe {
            Error::check(BCryptCreateHash(
                self.handle.as_ptr(),
                hash_handle.as_mut_ptr(),
                object.as_mut_ptr(),
                object.len() as ULONG,
                null_mut(),
                0,
                0,
            ))
            .map(|_| Hash {
                handle: hash_handle,
                _object: object,
            })
        }
    }
pub fn new_hash ( & self ) -> Result < Hash > { let object_size = self . handle . get_property :: < DWORD > ( BCRYPT_OBJECT_LENGTH ) ? as usize ; let mut hash_handle = HashHandle :: new ( ) ; let mut object = Buffer :: new ( object_size ) ; unsafe { Error :: check ( BCryptCreateHash ( self . handle . as_ptr ( ) , hash_handle . as_mut_ptr ( ) , object . as_mut_ptr ( ) , object . len ( ) as ULONG , null_mut ( ) , 0 , 0 , ) ) . map ( | _ | Hash { handle : hash_handle , _object : object , } ) } }
Creates a new hash from the algorithm
Creates a new hash from the algorithm
&self
&self