MCPcopy Create free account
hub / github.com/IfcOpenShell/IfcOpenShell / compress

Function compress

src/ifcparse/IfcGlobalId.cpp:69–77  ·  view source on GitHub ↗

Compresses the UUID byte array into a base64 representation

Source from the content-addressed store, hash-verified

67
68// Compresses the UUID byte array into a base64 representation
69std::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
80void expand(const std::string& s, std::vector<unsigned char>& v) {

Callers 1

IfcGlobalIdMethod · 0.70

Calls 2

base64Function · 0.85
reserveMethod · 0.80

Tested by

no test coverage detected