Is a Firebase UID always 28 characters?

Finlay Percy picture Finlay Percy · May 11, 2017 · Viewed 8k times · Source

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

Answer

Joe Clay picture Joe Clay · May 11, 2017

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.