Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is a Firebase UID always 28 characters?

Tags:

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

like image 358
Finlay Percy Avatar asked May 11 '17 09:05

Finlay Percy


People also ask

What is the length of Firebase uid?

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.

What is the length of the uid?

A Universal Unique Identifier (UUID) is a 128-bit number used to uniquely identify some object or entity on the Internet.

Is Firebase uid unique?

The user's Firebase UID. This is unique within a project. Dictionary of all the identities that are associated with this user's account.

Is Firebase uid a UUID?

UIDs in firebase are UUIDs as well. UIDs are nowadays indeed UUIDs.


2 Answers

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.

like image 159
Joe Clay Avatar answered Sep 18 '22 09:09

Joe Clay


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

like image 41
U.Munkhbat Avatar answered Sep 21 '22 09:09

U.Munkhbat