Is a Firebase UID always 28 characters?

对着背影说爱祢 提交于 2019-12-30 17:22:26

问题


I am creating security rules for my Firebase project and wanted to add UIDstring.length == 28 to my database rules. All of my users UIDs are 28 characters, but I wanted to check if they can be any longer or shorter?

Thanks


回答1:


A Firebase developer had this to say on their forums:

I would not rely on a constant length for the UIDs forever. We chose the current value because it provides a big enough ID space while still being under the 36-character limit for Firebase Analytics user properties.

So, in other words, what you're suggesting may or may not fail in the future, so you probably should find a different way of implementing it that's more future-proof.




回答2:


The uid of type string is used to assign to the newly created user. Must be a string between 1 and 128 characters long, inclusive. If not provided, a random uid will be automatically generated.

https://firebase.google.com/docs/auth/admin/manage-users



来源:https://stackoverflow.com/questions/43911234/is-a-firebase-uid-always-28-characters

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