Rosetta
Namespaces | Functions
Binary_Util.hh File Reference
#include <string>
#include <platform/types.hh>

Namespaces

 utility
 unresizable vector whose size is known at compile time, which may be allocated on the stack, and which indexes from 0.
 

Functions

void utility::swap4_aligned (void *v, long ndata)
 
unsigned char utility::code_to_6bit (unsigned char _6bit)
 
unsigned char utility::code_from_6bit (unsigned char _8bit)
 
void utility::encode_24_to_32 (unsigned char i0, unsigned char i1, unsigned char i2, unsigned char &o0, unsigned char &o1, unsigned char &o2, unsigned char &o3)
 
void utility::decode_32_to_24 (unsigned char i0, unsigned char i1, unsigned char i2, unsigned char i3, unsigned char *o0, unsigned short goodbytes)
 
void utility::encode6bit (const unsigned char *memory, unsigned int length, std::string &jar)
 Given a block of memory (with memory pointing to the first byte) and a byte count (length), convert every three bytes of memory into four bytes of ASCII characters, and populate the string (jar) with those characters. More...
 
platform::Size utility::decode6bit (unsigned char *memory, std::string const &jar, platform::Size const maxbytes)
 Given 3*N bytes of memory to fill, and a string containing 4*N characters, decode the characters (interpreting 4 bytes of ASCII text as 3 binary bytes) and populate the block of memory. More...