What characters are allowed in a Google App Engine Key?

瘦欲@ 提交于 2020-01-03 07:31:45

问题


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 ;) )



来源:https://stackoverflow.com/questions/1940128/what-characters-are-allowed-in-a-google-app-engine-key

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!