A cryptographic digest class.
More...
#include <secure.h>
|
| Digest (const char *type) |
|
secure::keybytes | key (void) |
|
secure::string | operator * () |
|
bool | operator *= (const char *text) |
|
| operator bool () const |
|
| operator secure::string () |
|
bool | operator! () const |
|
bool | operator+= (const char *text) |
|
Digest & | operator<< (const char *str) |
|
Digest & | operator<< (int16_t value) |
|
Digest & | operator<< (int32_t value) |
|
Digest & | operator<< (const PrintProtocol &p) |
|
Digest & | operator= (const char *id) |
|
bool | put (const void *memory, size_t size) |
|
bool | puts (const char *str) |
|
void | recycle (bool binary=false) |
| Finalize and recycle current digest to start a new digest. More...
|
|
void | reset (void) |
| Reset and restart digest object.
|
|
void | set (const char *id) |
|
unsigned | size () const |
|
secure::string | str (void) |
|
|
static bool | has (const char *name) |
| Test to see if a specific digest type is supported. More...
|
|
static secure::string | md5 (const char *text) |
| Shortcut for short md5 digests if supported... More...
|
|
static secure::keybytes | md5 (const uint8_t *mem, size_t size) |
|
static secure::string | sha1 (const char *text) |
|
static secure::keybytes | sha1 (const uint8_t *mem, size_t size) |
|
static secure::string | sha256 (const char *text) |
|
static secure::keybytes | sha256 (const uint8_t *mem, size_t size) |
|
static secure::string | sha384 (const char *text) |
|
static secure::keybytes | sha384 (const uint8_t *mem, size_t size) |
|
static secure::string | uuid (const char *name, const uint8_t *ns=NULL) |
|
|
const uint8_t * | get (void) |
|
void | release (void) |
|
A cryptographic digest class.
This class can support md5 digests, sha1, sha256, etc, depending on what the underlying library supports. The hash class accumulates the hash in the object.
- Author
- David Sugar dyfet.nosp@m.@gnu.nosp@m.telep.nosp@m.hony.nosp@m..org
- Examples
- digest.cpp.
Definition at line 509 of file secure.h.
◆ has()
static bool ucommon::Digest::has |
( |
const char * |
name | ) |
|
|
static |
Test to see if a specific digest type is supported.
- Parameters
-
name | of digest we want to check. |
- Returns
- true if supported, false if not.
◆ md5()
static secure::string ucommon::Digest::md5 |
( |
const char * |
text | ) |
|
|
static |
Shortcut for short md5 digests if supported...
- Parameters
-
text | to create a digest for. |
- Returns
- digest string.
- Examples
- digest.cpp.
◆ recycle()
void ucommon::Digest::recycle |
( |
bool |
binary = false | ) |
|
Finalize and recycle current digest to start a new digest.
- Parameters
-
binary | digest used rather than text if true. |
The documentation for this class was generated from the following file: