Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 5 of 5 total
Thread Create GUID - Javascript
Tue, Feb 21 2017 1:33 PMPermanent Link

Walter Matte

Tactical Business Corporation


Use external JS to generate GUID.

Walter



Attachments: TestGuid.zip
Thu, Mar 8 2018 8:23 PMPermanent Link

Frederick Chin

Walter,

/*
Use external JS to generate GUID.
*/

Are GUIDs guaranteed to be unique and be used as a replacement for autoinc fields?

--
Frederick
Fri, Mar 9 2018 4:22 AMPermanent Link

Walter Matte

Tactical Business Corporation

There are other JS implementations that are better.

Walter
Fri, Mar 9 2018 5:12 AMPermanent Link

Matthew Jones

Walter Matte wrote:

> There are other JS implementations that are better.

It is an interesting question as to why there is no built-in GUID generator in Javascript. But it does depend on what you need to achieve. When I was working on how I was going to generate them, I decided I didn't like the quality of the javascript ones - and so I just have my code keep a cache of GUIDs that it keeps topped up by asking the server (Delphi) for more. This is kept in local storage, so it isn't much cost. It strikes me that you could easily have the server send a prefix for clients to use, which could then guarantee system uniqueness. But that gets to awkward design, and again, pity it is not standard.

--

Matthew Jones
Fri, Mar 9 2018 8:43 AMPermanent Link

Frederick Chin

Walter Matte wrote:

/*
There are other JS implementations that are better.
*/

I suppose that as a test to see if the GUID is unique, I could store it in a field with a primary index and if the storage fails, I would know that the GUID is not unique and I need to get another one.

--
Frederick
Image