9

While testing my Google App Engine application, I search for links which include app engine keys. For example:

/story/ag5yZXBsaWUtdGVzdGluZ3IMCxIFU3RvcnkY-w0M/

What characters are allowed in these keys? I had been using the regex [a-zA-Z0-9], but it seems "-" is also allowed. What else?

Is there a reference on this? I can't find it in the App engine docs.

Paul Biggar
  • 27,579
  • 21
  • 99
  • 152

2 Answers2

7

Google App Engine keys are encoded using URL safe base 64 encoding (see The source code for the Key datastore type).

Håvard S
  • 23,244
  • 8
  • 61
  • 72
  • I would guess its safe to say that the deployed version uses this too, and that its not just the development server. – Paul Biggar Dec 21 '09 at 13:50
1

it's very probably all digits, upper- and lowercase letters, underscore and hyphen (try to base64.urlsafe_b64decode this string ;) )

mykhal
  • 19,175
  • 11
  • 72
  • 80