Jump to content

enc

From Hugo's wiki

enc is a pair of single-header encoding and hashing libraries in C.

Base64

  • Converts a void * byte stream to a base64 char * string and back.
  • Parallel encoding and decoding with OpenMP.
  • No initialization; O(n) time and space; C99 or later.
char *b64_enc(const void *data, size_t size, size_t *new_size);
void *b64_dec(const char *data, size_t size, size_t *new_size);

SHA-256

int sha256(int fdin, size_t size, int fdout);
Warning In its author's words: "I don't know if it works but it looks like if so."

See also