What characters are allowed in a Google App Engine

2019-06-16 04:16发布

问题:

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.

回答1:

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



回答2:

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