Is a Firebase UID always 28 characters?

13,289

Solution 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.

Solution 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

Share:
13,289

Related videos on Youtube

Finlay Percy
Author by

Finlay Percy

Javascript and Firebase Developer at Folded Group. BSc Audio Technology Graduate from Bournemouth University

Updated on June 06, 2022

Comments

  • Finlay Percy
    Finlay Percy almost 2 years

    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

  • Hendy Irawan
    Hendy Irawan over 4 years
    makes the most sense to me
  • CoderUni
    CoderUni over 3 years
    Although the length of the uid you can assign can be between 1 and 128 characters, this doesn't mean that the length of the auto-generated firebase uid will be between 1 and 128 characters. Look at the uid property in firebase.google.com/docs/auth/admin/manage-users#create_a_us‌​er
  • Nikos
    Nikos over 3 years
    quite annoying if you concat uid's to make another key and depend on the length
  • Muhammad Saqib
    Muhammad Saqib over 2 years
    This answer is helpful if you want to set varchar length of UID in your database. So now you know 128 is the max possible length.