Storing UUID as base64 String

I was also trying to do something similar. I am working with a Java application which uses UUIDs of the form 6fcb514b-b878-4c9d-95b7-8dc3a7ce6fd8 (which are generated with the standard UUID lib in Java). In my case I needed to be able to get this UUID down to 30 characters or less. I used Base64 and these … Read more

Android: How do bluetooth UUIDs work?

The UUID is used for uniquely identifying information. It identifies a particular service provided by a Bluetooth device. The standard defines a basic BASE_UUID: 00000000-0000-1000-8000-00805F9B34FB. Devices such as healthcare sensors can provide a service, substituting the first eight digits with a predefined code. For example, a device that offers an RFCOMM connection uses the short … Read more

Using UUIDs in SQLite

CL’s answer is correct but kind of skirts the issue at hand. As mentioned, a column (or multiple columns) of any type can be used as a primary key. So you could store the UUID as a formatted, human-readable string and make that your table’s key. And since a UUID is just a 128-bit integer, … Read more

What is a UUID?

It’s an identification number that will uniquely identify something. The idea being that id number will be universally unique. Thus, no two things should have the same uuid. In fact, if you were to generate 10 trillion uuids, there would be something along the lines of a .00000006 chance of two uuids being the same.

Example of UUID generation using Boost in C++

A basic example: #include <boost/uuid/uuid.hpp> // uuid class #include <boost/uuid/uuid_generators.hpp> // generators #include <boost/uuid/uuid_io.hpp> // streaming operators etc. int main() { boost::uuids::uuid uuid = boost::uuids::random_generator()(); std::cout << uuid << std::endl; } Example output: 7feb24af-fc38-44de-bc38-04defc3804de

UUID format: 8-4-4-4-12 – Why?

It’s separated by time, version, clock_seq_hi, clock_seq_lo, node, as indicated in the following rfc. From the IETF RFC4122: 4.1.2. Layout and Byte Order To minimize confusion about bit assignments within octets, the UUID record definition is defined only in terms of fields that are integral numbers of octets. The fields are presented with the most … Read more