Generating UUIDs with the 'tag:' URI scheme
What no 4e0c21aa-03f8-11dc-8528-000d616f1a9f?
For some time I've been tripping over the need to generate unique identifiers for things. I've always managed to avoid actually having to do so one way or another, but (to make a cliched paraphrase) "with great blog engine comes great responsibility": in order to generate an Atom RSS feed, I need to generate identifiers for each posts.
So far I've been expecting this to involve generating 128-bit UUIDs (as described in RFC 4122) using one of several algorithms, none of which are simple, and all of which seem much too involved when I'm simply trying to stop a feed aggregator confusing my posts.
All of this might explain why I was so happy to find a page describing how to generate a tag URI. Especially so when I realised there was an RFC for the procedure. I won't try to cover all the details they give there, but in a nutshell the procedure is approximately this
- Start off with '
tag:' . - Add your e-mail address, or domain name if you have one.
- Add a comma, and follow that by the date in
2007-01-01format. - Think of a name which hasn't already been used for that combination of address/domain and date, and separate it from what's gone before using a colon.
- The end result might look like this:
tag:pdw.org.uk,2007-05-16:Example - Profit!
Hopefully you might find it useful (or at least informative). I know I will!
For more details, see http://www.taguri.org.