32 explicit Sha1Sum(std::string_view hex);
38 void parse40(std::span<const char, 40> str);
39 [[nodiscard]] std::string
toString()
const;
42 [[nodiscard]]
bool empty()
const;
53 std::array<uint32_t, 5> a;
72 void update(std::span<const uint8_t> data);
79 [[nodiscard]]
static Sha1Sum calc(std::span<const uint8_t> data);
82 void transform(std::span<const uint8_t, 64> buffer);
88 std::array<uint8_t, 64> m_buffer;
89 bool m_finalized =
false;
Helper class to perform a sha1 calculation.
Sha1Sum digest()
Get the final hash.
void update(std::span< const uint8_t > data)
Incrementally calculate the hash value.
static Sha1Sum calc(std::span< const uint8_t > data)
Easier to use interface, if you can pass all data in one go.
This class represents the result of a sha1 calculation (a 160-bit value).
Sha1Sum(UninitializedTag)
constexpr auto operator<=>(const Sha1Sum &) const =default
void parse40(std::span< const char, 40 > str)
Parse from a 40-character long buffer.
friend std::ostream & operator<<(std::ostream &os, const Sha1Sum &sum)
std::string toString() const
This file implemented 3 utility functions:
constexpr auto sum(InputRange &&range, Proj proj={})