Compresses the UUID byte array into a base64 representation
| 67 | |
| 68 | // Compresses the UUID byte array into a base64 representation |
| 69 | std::string compress(unsigned char* value) { |
| 70 | std::string result; |
| 71 | result.reserve(22); |
| 72 | result += base64(value[0], 2); |
| 73 | for (unsigned i = 1; i < 16; i += 3) { |
| 74 | result += base64((value[i] << 16) + (value[i + 1] << 8) + value[i + 2], 4); |
| 75 | } |
| 76 | return result; |
| 77 | } |
| 78 | |
| 79 | // Expands the base64 representation into a UUID byte array |
| 80 | void expand(const std::string& s, std::vector<unsigned char>& v) { |
no test coverage detected