A few questions regarding the functionality of NoteIDs:
-
Does NoteID use 0-9 and the entire alphabet or only ‘a - f’ as with a hex value?
-
How many possible combinations are there for this 8 character ID?
-
What happens if/when there are no more unique combinations and a new document is saved?
Does anyone know a good formula for defining a unique identifier which uses 0-9 and the full alphabet?
Thanks in advance,
Marc Robson
Subject: NoteID questions
-
It is hex: 0 - 9, A - F.2) About 4 billion, but they go in steps of 4 and half are reserved for deletion stubs, so only about 500 million are useable.
-
Your database probably reaches 64 GB or some other limit before that happens.
A random string is easy, but if you really wnat it to be unique then you have to check all the others in the universe. Could you use a document’s universal ID instead? It is guarenteed to be unique in the database.
Subject: RE: NoteID questions
There will be only a single replica, so NoteID is unique enough for my use.
My thinking is that with 0-9, a-z that it only takes 4 characters to reach 810,000 possibilities - 5 characters is 24,300,000 possibilities.
For ease of use I would like the shortest unique identifier possible (this value is used in the URL for going directly to the document).
It is my understanding that the universal ID adds uniqueness among multiple replicas of the same database. It also doubles the length of the unique identifier to 16 characters. Since I will only need uniqueness within a single replica of a database the universal ID is overkill in my case.
Thanks for the info - it looks like NoteID will be the best choice for me since the assignment of NoteID is handled by the system (not by my code) and is only 3 characters longer than I could hope to achieve doing this myself.
Thanks to both of you for your answers,
Marc
Subject: NoteID questions
NoteID is stored as a DWORD (4 byte).notes skips every second NoteID (for docs), so that would be 2147483648 different values (from 00000000-FFFFFFFF)
NoteIds are usually displayed as hex (chars). (0…F 16 values).
you don’t have to worry at all…
Subject: You have to divide that in half because &H80000000 is the flag for a deleted Note.