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

Function expand

src/ifcparse/IfcGlobalId.cpp:80–88  ·  view source on GitHub ↗

Expands the base64 representation into a UUID byte array

Source from the content-addressed store, hash-verified

78
79// Expands the base64 representation into a UUID byte array
80void expand(const std::string& s, std::vector<unsigned char>& v) {
81 v.push_back((unsigned char)from_base64(s.substr(0, 2)));
82 for (unsigned i = 0; i < 5; ++i) {
83 unsigned d = from_base64(s.substr(2 + 4 * i, 4));
84 for (unsigned j = 0; j < 3; ++j) {
85 v.push_back((d >> (8 * (2 - j))) % 256);
86 }
87 }
88}
89
90// Define the macro to handle different Boost versions
91#if BOOST_VERSION >= 108600

Callers 1

IfcGlobalIdMethod · 0.70

Calls 3

from_base64Function · 0.85
push_backMethod · 0.80
substrMethod · 0.80

Tested by

no test coverage detected