|
BigDigits C++ OOP
1.0.1
|
Utilities for a vector of bytes. More...
Static Public Member Functions | |
| static std::vector< unsigned char > | from_hex (std::string s) |
| Decodes a hex-encoded string to a byte vector. More... | |
| static void | print_hex (std::string prefix, std::vector< unsigned char > barr, std::string sep=" ") |
| Print contents of byte array vector in hex with prefix. More... | |
| static void | print_hex (std::vector< unsigned char > barr, std::string sep=" ") |
| Print contents of byte array vector in hex. More... | |
Utilities for a vector of bytes.
|
static |
Decodes a hex-encoded string to a byte vector.
| s | String of hex digits (with or without a '0x' prefix) |
| std::invalid_argument | exception if an invalid character is found. |
|
static |
Print contents of byte array vector in hex with prefix.
| prefix | Prefix string. |
| barr | A vector of bytes. |
| sep | Optional separator string (default=" ", space) |
|
static |
Print contents of byte array vector in hex.
| barr | A vector of bytes. |
| sep | Optional separator string (default=" ") BigDigit b(0xdeadbeef);
std::vector<unsigned char> barr = b.to_octets();
Bvec::print_hex(barr); // de ad be ef
// Specify exact length
barr = b.to_octets(6);
Vec::print_hex(barr); // 00 00 de ad be ef
static void print_hex(std::vector< unsigned char > barr, std::string sep=" ") Print contents of byte array vector in hex. |