Thursday, November 08, 2007

Web Service: GetGuid

OK, this is the first method I've put in this set of free web services. Why GetGuid?

I had a need to grab a GUID in javascript from time-to-time but had my doubts that it could be done in earnest in javascript. There are a few implements hanging around where random base16 characters are strung together in a GUID-like format, but this algorithm doesn't fall under the "official" designation of GUID and I guess allows for a greater chance of generating a duplicate GUID (although I think those chances are infinitesimal).

So, this web service exists as it calls upon the GUID-creating ability of Microsoft SQL Server. I chose this route rather than the GUID methods in the .Net framework because I've been working on getting my database chops back up to snuff and this seemed like a pretty low-stress way of starting that. In any event, it should be a true GUID and technically the numbers should never duplicate.



Method: GetGuid
JSON Parameters:
  1. op -- set to "GetGuid".
  2. cb -- set to the name of your javascript function you want called back.
Returns:
GUID in string format.

No comments: