1

I noticed on YouTube their keys look like this "BwgT06NY1FE". I was just wondering how is this type of key created? Is this based on a GUID?

Samuel Liew
  • 76,741
  • 107
  • 159
  • 260
Ryan
  • 4,354
  • 2
  • 42
  • 78

1 Answers1

0

This is most likely Base36. All letters and numbers. It's pretty common, because you can use a "SERIAL" in a database and just increment it, and then just parse from Base36 in your URL.

It makes for nice URLs (bit.ly also uses this format), but has some drawbacks. Ie, you wouldn't want to use it for any sort of private data because people can just type in a random number and get a result (it's unlikely someone could guess a GUID in use by your database unless they try a few billion)..

Mike Christensen
  • 88,082
  • 50
  • 208
  • 326
  • It is not common that Base36 produces a string with both upper & lower cases. 10 numbers + 26 chars – L.B Oct 28 '11 at 20:24
  • Yea I guess you could find out by seeing if that URL is case sensitive.. But you're right maybe it's their own encoding. Sometimes they encode special bits in there to indicate which node on a cluster the data is on or other scaling related information. – Mike Christensen Oct 28 '11 at 21:02
  • I just tried. case sensitive. – L.B Oct 28 '11 at 21:19