Lines Matching defs:hash
1 //! Message digest (hash) computation support.
5 //! Calculate a hash in one go:
9 //! use openssl::hash::{hash, MessageDigest};
13 //! let res = hash(MessageDigest::md5(), data)?;
21 //! use openssl::hash::{Hasher, MessageDigest};
206 /// Provides message digest (hash) computation.
211 /// use openssl::hash::{Hasher, MessageDigest};
228 /// Don't ever hash passwords, use the functions in the `pkcs5` module or bcrypt/scrypt instead.
232 /// and provide a `buf` to store the hash. The hash will be as long as
245 /// Creates a new `Hasher` with the specified hash type.
292 /// Returns the hash of the data written and resets the non-XOF hasher.
316 /// Writes the hash of the data into the supplied buf and resets the XOF hasher.
317 /// The hash will be as long as the buf.
422 /// Computes the hash of the `data` with the non-XOF hasher `t`.
428 /// use openssl::hash::{hash, MessageDigest};
432 /// let res = hash(MessageDigest::md5(), data)?;
436 pub fn hash(t: MessageDigest, data: &[u8]) -> Result<DigestBytes, ErrorStack> {
442 /// Computes the hash of the `data` with the XOF hasher `t` and stores it in `buf`.
447 /// use openssl::hash::{hash_xof, MessageDigest};
471 let res = hash(hashtype, &Vec::from_hex(hashtest.0).unwrap()).unwrap();
540 let null = hash(MessageDigest::md5(), &[]).unwrap();