[fpc-pascal] GUIDs under FreeBSD don't seem very random
mailinglists at geldenhuys.co.uk
Wed Jan 6 00:56:26 CET 2016
I use GUID's as my primary key values in databases. tiOPF uses the
following FPC functions to do this
Result := GUIDToString(lGUID);
I just noticed this difference between two of my databases.
The following GUID's were generated a few minutes ago by FPC (under
FreeBSD) when I imported some data.
Another database of mine has GUID's as follows (records were created in
Note that the second (older) set of GUID's are much more random.
Unfortunately I don't know what OS platform I used to generate that data
- I think in was under a Linux system.
My initial thought was that FPC 3.0 changed something, but then I
recompiled by application with FPC 2.6.4 (FreeBSD) and imported some
more data. The new GUID's generated appeared like the first set under
both FPC 2.6.4 and 3.0 using FreeBSD.
The first set don't appear to be very random - this is my worry. I'm
about it import about 1-2 million records using a FreeBSD system. Is
it something I need to worry about?
Why is the one set of GUID's much more random looking than the others?
I'm assuming FPC uses different algorithms depending on the OS platform.
The FPC help seems to suggest this too.
I just remembered about a *nix console tool "uuidgen" and ran it a
couple of times on my FreeBSD system. The GUID's (or UUID's - not sure
the difference) have the exact same format as the first set of GUID's
above. So I'm assuming FPC is using FreeBSD's UUID generator under
FreeBSD, so that would explain the similarity to the uuidgen tool.
>From Wikipedia (GUID vs UUID)
The term GUID usually refers to Microsoft's implementation of the
Universally Unique Identifier (UUID) standard.
So am I to assume that I will still get unique values even if I generate
1-2 million records in succession?
- Graeme -
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
My public PGP key: http://tinyurl.com/graeme-pgp
More information about the fpc-pascal