RESTinio

Namespaces | Classes | Typedefs | Functions | Variables
restinio::utils::sha1 Namespace Reference

## Namespaces
namespace | details

## Classes
struct | builder_t

## Typedefs
using | byte_block_t = std::array< std::uint8_t, block_size >
using | int_block_t = std::array< std::uint32_t, block_ints >
using | digest_t = std::array< std::uint32_t, digest_array_size >

## Functions
template<class T >
std::uint8_t | as_uint8 (T what)
template<class T >
std::uint32_t | as_uint32 (T what)
template<class T >
const std::uint8_t * | as_uint8_ptr (const T *what)
template<unsigned int Shift>
std::uint32_t | rotate_left (const std::uint32_t x)
template<unsigned int Shift>
std::uint8_t | octet_from (std::uint32_t x)
void | R0 (const int_block_t &block, const uint32_t v, uint32_t &w, const uint32_t x, const uint32_t y, uint32_t &z, const size_t i)
void | R1 (int_block_t &block, const uint32_t v, uint32_t &w, const uint32_t x, const uint32_t y, uint32_t &z, const size_t i)
void | R2 (int_block_t &block, const uint32_t v, uint32_t &w, const uint32_t x, const uint32_t y, uint32_t &z, const size_t i)
void | R3 (int_block_t &block, const uint32_t v, uint32_t &w, const uint32_t x, const uint32_t y, uint32_t &z, const size_t i)
void | R4 (int_block_t &block, const uint32_t v, uint32_t &w, const uint32_t x, const uint32_t y, uint32_t &z, const size_t i)
void | transform (digest_t &digest, const byte_block_t &buf)
std::string | to_hex_string (const digest_t &what)
std::string | to_string (const digest_t &what)
digest_t | make_digest (const std::uint8_t *what, std::size_t length)
template<class T >
digest_t | make_digest (const T *begin, const T *end)
digest_t | make_digest (const char *what, std::size_t length)
digest_t | make_digest (string_view_t sv)

## Variables
constexpr std::uint8_t | block_size = 64
constexpr std::uint8_t | block_ints = 16
constexpr std::uint8_t | word_size = 4
constexpr std::uint8_t | digest_size = 20
constexpr std::size_t | digest_array_size = digest_size / word_size

## Typedef Documentation

## ◆ byte_block_t

using restinio::utils::sha1::byte_block_t = typedef std::array< std::uint8_t, block_size >

Definition at line 43 of file sha1.hpp.

## ◆ digest_t

using restinio::utils::sha1::digest_t = typedef std::array< std::uint32_t, digest_array_size >

Definition at line 45 of file sha1.hpp.

## ◆ int_block_t

using restinio::utils::sha1::int_block_t = typedef std::array< std::uint32_t, block_ints >

Definition at line 44 of file sha1.hpp.

## Function Documentation

## ◆ as_uint32()

template<class T >

std::uint32_t restinio::utils::sha1::as_uint32 | ( | T | what | ) |
| inline

Definition at line 56 of file sha1.hpp.

## ◆ as_uint8()

template<class T >

std::uint8_t restinio::utils::sha1::as_uint8 | ( | T | what | ) |
| inline

Definition at line 49 of file sha1.hpp.

## ◆ as_uint8_ptr()

template<class T >

const std::uint8_t * restinio::utils::sha1::as_uint8_ptr | ( | const T * | what | ) |

Definition at line 63 of file sha1.hpp.

## ◆ make_digest() [1/4]

digest_t restinio::utils::sha1::make_digest | ( | const char * | what,
|  | std::size_t | length
| ) |  |
| inline

Definition at line 434 of file sha1.hpp.

## ◆ make_digest() [2/4]

digest_t restinio::utils::sha1::make_digest | ( | const std::uint8_t * | what,
|  | std::size_t | length
| ) |  |
| inline

Definition at line 417 of file sha1.hpp.

## ◆ make_digest() [3/4]

template<class T >

digest_t restinio::utils::sha1::make_digest | ( | const T * | begin,
|  | const T * | end
| ) |  |
| inline

Definition at line 424 of file sha1.hpp.

## ◆ make_digest() [4/4]

digest_t restinio::utils::sha1::make_digest | ( | string_view_t | sv | ) |
| inline

Definition at line 441 of file sha1.hpp.

## ◆ octet_from()

template<unsigned int Shift>

std::uint8_t restinio::utils::sha1::octet_from | ( | std::uint32_t | x | ) |
| inline

Definition at line 77 of file sha1.hpp.

## ◆ R0()

void restinio::utils::sha1::R0 | ( | const int_block_t & | block,
|  | const uint32_t | v,
|  | uint32_t & | w,
|  | const uint32_t | x,
|  | const uint32_t | y,
|  | uint32_t & | z,
|  | const size_t | i
| ) |  |
| inline

Definition at line 89 of file sha1.hpp.

## ◆ R1()

void restinio::utils::sha1::R1 | ( | int_block_t & | block,
|  | const uint32_t | v,
|  | uint32_t & | w,
|  | const uint32_t | x,
|  | const uint32_t | y,
|  | uint32_t & | z,
|  | const size_t | i
| ) |  |
| inline

Definition at line 97 of file sha1.hpp.

## ◆ R2()

void restinio::utils::sha1::R2 | ( | int_block_t & | block,
|  | const uint32_t | v,
|  | uint32_t & | w,
|  | const uint32_t | x,
|  | const uint32_t | y,
|  | uint32_t & | z,
|  | const size_t | i
| ) |  |
| inline

Definition at line 106 of file sha1.hpp.

## ◆ R3()

void restinio::utils::sha1::R3 | ( | int_block_t & | block,
|  | const uint32_t | v,
|  | uint32_t & | w,
|  | const uint32_t | x,
|  | const uint32_t | y,
|  | uint32_t & | z,
|  | const size_t | i
| ) |  |
| inline

Definition at line 114 of file sha1.hpp.

## ◆ R4()

void restinio::utils::sha1::R4 | ( | int_block_t & | block,
|  | const uint32_t | v,
|  | uint32_t & | w,
|  | const uint32_t | x,
|  | const uint32_t | y,
|  | uint32_t & | z,
|  | const size_t | i
| ) |  |
| inline

Definition at line 123 of file sha1.hpp.

## ◆ rotate_left()

template<unsigned int Shift>

std::uint32_t restinio::utils::sha1::rotate_left | ( | const std::uint32_t | x | ) |

Definition at line 70 of file sha1.hpp.

## ◆ to_hex_string()

std::string restinio::utils::sha1::to_hex_string | ( | const digest_t & | what | ) |
| inline

Definition at line 373 of file sha1.hpp.

## ◆ to_string()

std::string restinio::utils::sha1::to_string | ( | const digest_t & | what | ) |
| inline

Definition at line 398 of file sha1.hpp.

## ◆ transform()

void restinio::utils::sha1::transform | ( | digest_t & | digest,
|  | const byte_block_t & | buf
| ) |  |
| inline

Definition at line 131 of file sha1.hpp.

## Variable Documentation

## ◆ block_ints

constexpr std::uint8_t restinio::utils::sha1::block_ints = 16
| constexpr

Definition at line 32 of file sha1.hpp.

## ◆ block_size

constexpr std::uint8_t restinio::utils::sha1::block_size = 64
| constexpr

Definition at line 29 of file sha1.hpp.

## ◆ digest_array_size

constexpr std::size_t restinio::utils::sha1::digest_array_size = digest_size / word_size
| constexpr

Definition at line 41 of file sha1.hpp.

## ◆ digest_size

constexpr std::uint8_t restinio::utils::sha1::digest_size = 20
| constexpr

Definition at line 38 of file sha1.hpp.

## ◆ word_size

constexpr std::uint8_t restinio::utils::sha1::word_size = 4
| constexpr

Definition at line 35 of file sha1.hpp.