# IfcGloballyUniqueIds spec description is incorrect - proposal to simplify

**URL:** <https://forums.buildingsmart.org/t/ifcgloballyuniqueids-spec-description-is-incorrect-proposal-to-simplify/1083>\
**Category:** Developers\
**Created:** [February 27, 2019, 10:58am UTC](https://forums.buildingsmart.org/t/ifcgloballyuniqueids-spec-description-is-incorrect-proposal-to-simplify/1083 "2019-02-27T10:58:49Z")\
**Posts on this page:** 1\
**Showing post:** 8

<div class="post-metadata">

**Author:** ![aothms](https://avatars.discourse-cdn.com/v4/letter/a/c67d28/32.png) [@aothms](https://forums.buildingsmart.org/u/aothms)\
**Post date:** [March 1, 2019, 12:43pm UTC](https://forums.buildingsmart.org/t/ifcgloballyuniqueids-spec-description-is-incorrect-proposal-to-simplify/1083/8 "2019-03-01T12:43:20Z")

</div>

@yorik the only difference between your code and ifcopenshell.guid.new() is the UUID version that is used: 4 for pure random instead of the deterministic mac + timestamp (in line with @Moult 's suggestion, although probably there are many valid use cases for the other versions, both derived as well as mac based) [https://github.com/IfcOpenShell/IfcOpenShell/blob/master/src/ifcopenshell-python/ifcopenshell/guid.py#L56](https://github.com/IfcOpenShell/IfcOpenShell/blob/master/src/ifcopenshell-python/ifcopenshell/guid.py#L56)

The IfcOpenShell Python implementation for the guid encoding is here, the equivalent is also implemented in C++ somewhere: [https://github.com/IfcOpenShell/IfcOpenShell/blob/master/src/ifcopenshell-python/ifcopenshell/guid.py#L38](https://github.com/IfcOpenShell/IfcOpenShell/blob/master/src/ifcopenshell-python/ifcopenshell/guid.py#L38)

The procedure is as follows, although I agree this should be written in the documentation and not just hidden in some sample implementations:

- The first byte is encoded in the first two characters
- then the remaining bytes are encoded in groups of 3, taking up 4 characters

In the first two characters there are indeed some bits unused as 64 ^ 2 \> 256. The remaining sequence takes up all bits as 64 ^ 4 = 256 ^ 3

---

_[View the full topic](https://forums.buildingsmart.org/t/ifcgloballyuniqueids-spec-description-is-incorrect-proposal-to-simplify/1083)._
