![]() ![]() IMHO the only time-related function suitable is, perhaps, the GetTickCount since it is a 'count' and not 'time', but it is pointless because we can just get series of integers, N, as long we're not interested in the duration between each two instants. Even the client is perfectly synchronized with the server, the discontinuity can happen on the server itself. įor the present implementation: GetServerTimeStamp->NowUTC->GetSystemTime, there is no guarantee that it will be ever-increasing. Still, if privacy is a concern, we can use a random 48-bit number instead of the MAC address. In particular, the timestamp is measured in units of 100 nanoseconds from October 15, 1582. Just generate a GUID/UUID, and increase the integer. The Bacon Ipsum JSON API is a REST interface for creating lorem ipsum messages and can be utilized by any application or website. UUID version 1 uses the current timestamp and the MAC address of the device generating the UUID. The only way to do that without weakening the GUID/UUID randomness would be to prefix the 16-byte GUID/UUID with an unsigned integer (which would make your identifier data 20-bytes, or more, depending on your integer). Also there is a cases when somebody wants to cheat and adjusts the time to register some action earlier than it happened. Now, you want the GUID/UUID to be ordered in time. Also the hardware clock drifts - the user may have a good reason for the adjustment. Theres a UUID module in python that we can import and it gives us access to versions 1,3,4, and 5 of the UUID generator. The adjustment may come even from the system itself when configured to "Intenet time" on the first synchronization with the time server. This will immediately result in smaller ID's. ![]() there is no server all of the time, imagine the system clock adjusted backwards for example. We're talking for disconnected nodes here, i.e. This function does not generate cryptographically secure values. autofilled TModTime and TCreateTime published fields).Īnd a small time shift should not be a problem, IMHO.Īs long as for the uniqueness - yes, it should be OK.īut if we consider the monotonic property it may be not the case. We use the UTC dedicated API under Windows, so that we should not be affected by DST changes.Įvery timestamp is written in UTC within mORMot (e.g. See the ServerTimeStampSynchronize method. MORMot clients, you have a safe way of retrieving the server date time at connection. A very simple Java SE project to create individual or batches UUIDs. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |