UNISTDX_BASE_SHA1
class sys::sha1

Computes bytes digest using SHA-1 algorithm. Computes bytes digest using US Secure Hash Algorithm 1 (SHA-1).

Fields
  • char _chars[20]
  • unsigned char _bytes[20]
  • u32 _digest[5]
  • u64 _dwords[8]
  • u32 _words[80]
  • unsigned char _block[64]
Methods
  • digest_bytes_length() -> constexpr int

    Returns 20.

  • digest_length() -> constexpr int

    Returns 5.

  • length() const -> std::size_t

    Get the length of SHA1 input in bits.

  • digest_chars() const -> const char *

    Get SHA-1 digest as a pointer to character array.

  • digest_bytes() const -> const unsigned char *

    Get SHA-1 digest as a pointer to unsigned byte array.

  • digest() const -> const u32 *

    Get SHA-1 digest as a pointer to unsigned integer array.

  • digest(u32 * result) -> void

    Copy SHA-1 digest to unsigned integer array pointed by result.

  • digest(char * result) -> void

    Copy SHA-1 digest to character array pointed by result.

  • digest(unsigned char * result) -> void

    Copy SHA-1 digest to byte array pointed by result.

  • compute() -> void

    Compute the final digest by padding the last block if needed. If the block does not require padding this method does nothing.

  • put(const char * first, const char * last) -> void

    Append next byte array between first and last and compute digest if possible.

    std::length_error
    if input size is too large to compute SHA-1 on this system

  • put(const char * first, std::size_t n) -> void

    Append next n bytes from array pointed by first and compute digest if possible.

    std::length_error
    if input size is too large to compute SHA-1 on this system

  • reset() -> void

    Reset SHA-1 object to start computing new hash.

  • sha1()

    Construct SHA-1 digest object.