Firebase UID 总是 28 个字符吗?
Is a Firebase UID always 28 characters?
我正在为我的 Firebase 项目创建安全规则,并想将 UIDstring.length == 28
添加到我的数据库规则中。我所有的用户 UID 都是 28 个字符,但我想检查它们是否可以更长或更短?
谢谢
一位 Firebase 开发人员在他们的论坛上有 this to say:
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.
所以,换句话说,你的建议在未来可能会或不会失败,所以你可能应该找到一种更适合未来的不同实施方式。
字符串类型的uid用于分配给新创建的用户。必须是长度介于 1 到 128 个字符(含)之间的字符串。如果未提供,将自动生成一个随机 uid。
我正在为我的 Firebase 项目创建安全规则,并想将 UIDstring.length == 28
添加到我的数据库规则中。我所有的用户 UID 都是 28 个字符,但我想检查它们是否可以更长或更短?
谢谢
一位 Firebase 开发人员在他们的论坛上有 this to say:
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.
所以,换句话说,你的建议在未来可能会或不会失败,所以你可能应该找到一种更适合未来的不同实施方式。
字符串类型的uid用于分配给新创建的用户。必须是长度介于 1 到 128 个字符(含)之间的字符串。如果未提供,将自动生成一个随机 uid。