Skip to main content

Blob

The Blob class extends the Stream class and provides a flexible way to manage binary data located in the system memory. The class also includes functions for base64 encoding and decoding, as well as calculating message digests using MD5 and SHA1 hash algorithms.

#include <core/TellusimBlob.h>

Inheritance

Constructors

explicit Blob(const char *name = nullptr)
explicit Blob(const String &name)
Blob(const uint8_t *data, size_t size, const char *name = nullptr)
Blob(const uint8_t (*blob)[256], const char *name = nullptr)
Blob(const Blob &blob, bool move)

Methods

Clear blob.

void release()
void clear()

Blob name.

void setName(const char *name)
void setName(const String &name)

Blob data.

void setSize(size_t size)
void setCapacity(size_t size)
size_t getCapacity() const
bool setData(const uint8_t *data, size_t size)
bool setData(const uint8_t (*blob)[256])
bool setData(const Blob &blob)
const uint8_t *getData() const
uint8_t *getData()

Base64 encoding.

String encodeBase64(size_t size = 0)
bool decodeBase64(const char *src)

Message digest algorithm.

void getMD5(uint32_t hash[4], size_t size = 0)
String getMD5(size_t size = 0)
static String getMD5(const String &str)
static String getMD5(const void *src, size_t size)
static String getMD5(Stream &src, size_t size = 0)

Secure hash algorithm.

void getSHA1(uint32_t hash[5], size_t size = 0)
String getSHA1(size_t size = 0)
static String getSHA1(const String &str)
static String getSHA1(const void *src, size_t size)
static String getSHA1(Stream &src, size_t size = 0)