12#ifndef OPENVPN_CRYPTO_HASHSTR_H
13#define OPENVPN_CRYPTO_HASHSTR_H
28 :
ctx(digest_factory.new_digest(digest_type))
34 ctx->
update((
unsigned char *)str.c_str(), str.length());
39 ctx->
update((
unsigned char *)str, std::strlen(str));
61 const size_t size =
ctx->
size();
62 if (size > output.max_size())
65 output.set_size(size);
#define OPENVPN_BUFFER_THROW(exc)
std::string encode(const V &data) const
const T * c_data() const
Returns a const pointer to the start of the buffer.
size_t size() const
Returns the size of the buffer in T objects.
virtual size_t final(unsigned char *out)=0
virtual size_t size() const =0
virtual void update(const unsigned char *in, const size_t size)=0
void update(const Buffer &buf)
void update(const char *str)
void update(const char c)
HashString(DigestFactory &digest_factory, const CryptoAlgs::Type digest_type)
std::string final_base64()
void update(const std::string &str)
static Ptr Create(ArgsT &&...args)
Creates a new instance of RcEnable with the given arguments.
constexpr BufferFlags ARRAY(1U<< 3)
if enabled, use as array
std::string render_hex_generic(const V &data, const bool caps=false)