Sorry for the bump, but in case people are reading this, @George 's code again follows the standardised way of base64… however the IFC documentation is still incorrect and misleading, and therefore @George’s code is actually not compliant with everybody else’s encoding.
Long story short, don’t use @George’s code, don’t use my code, the IFC docs still need updating to prevent people like me and @George making the same mistake in the future.
If you’re on Python, save yourself the trouble and import ifcopenshell
then use ifcopenshell.guid.new()
. Other languages will need to do some homework - don’t trust the IFC docs.