Open-Orange-Button / Orange-Button-Taxonomy

OpenAPI Orange Button taxonomy
https://Open-Orange-Button.github.io/Orange-Button-Taxonomy
Apache License 2.0
14 stars 18 forks source link

Add developer notes regarding UUID creation. #298

Open kevinkirkl3y opened 4 months ago

kevinkirkl3y commented 4 months ago

We want to provide a some kind of support around the preferred practice for creating UUIDs to be used within OB compliant data structures.

btansy commented 4 months ago

Python has a native uuid package documented here: https://docs.python.org/3/library/uuid.html Java can also generate UUID natively: https://docs.oracle.com/javase/8/docs/api/java/util/UUID.html Node doesn't have uuid generation natively, but there is an extremely popular open source uuid generator package available: https://www.npmjs.com/package/uuid

If you're interested in how the sausage is made wikipedia has a good explanation: https://en.wikipedia.org/wiki/Universally_unique_identifier

Because UUID is "universally" unique there is no need for a single source of truth or administrating authority. Users can generate one on their own and then use it to represent whatever they like. While UUID is not perfectly unique the likelihood of collision is small enough that we can consider them to be effectively unique. If Orange Button wants to go the extra mile we could recommend using method 1, which is date-time and MAC address (the the machine doing the UUID generation) dependent as it has the lowest probability of collision.