digestpp 1.0
C++11 header-only message digest library
Loading...
Searching...
No Matches
SHA1

SHA1 Algorithm More...

Typedefs

typedef hasher< detail::sha1_providerdigestpp::sha1
 SHA-1 hash function.
 

Detailed Description

SHA1 Algorithm

Typedef Documentation

◆ sha1

SHA-1 hash function.

First generation Secure Hash Algorithm designed by the NSA and published by NIST in 1995.

Warning
SHA-1 is cryptographically broken and should NOT be used for security purposes. Practical collision attacks exist since 2017. Use SHA-256, SHA-3, or any other hash function instead.

SHA-1 may still be acceptable for legacy system compatibility (when security is not required).

Type:
Cryptographic hash function.
Output size:
160 bits
Default size:
160 bits
Example:
// Output a SHA1 digest of a string
hasher.absorb("The quick brown fox jumps over the lazy dog");
std::cout << hasher.hexdigest() << '\n';
Main class template implementing the public API for hashing.
Definition hasher.hpp:38
std::string hexdigest() const
Return hex digest of absorbed data.
Definition hasher.hpp:372
hasher & absorb(const T *data, size_t len)
Absorbs bytes from a C-style pointer to character buffer.
Definition hasher.hpp:86
Example output:
2fd4e1c67a2d28fced849ee1bb76e7391b93eb12
See also
hasher, sha256, sha512, sha3