Raghav Bhagat
Raghav Bhagat

Reputation: 341

Firebase User ID Allowed Characters

I am creating a key combining two Firebase user IDs, such as .

Would anyone know the character set of which Firebase User IDs are comprised of? Ideally, the delimiter should not be in the possible character set forming the Firebase user IDs.

(P.S.: Am planning on using underscore "_" or double underscore "__" as the delimiter).

Upvotes: 11

Views: 3662

Answers (2)

Alix Axel
Alix Axel

Reputation: 154593

From my experience, the latest version of Firebase follows the ^[0-9a-zA-Z]{27}[0-9]$ pattern.

I don't know why there's always a digit at the end, but that seems to be consistent.

Upvotes: 6

bojeil
bojeil

Reputation: 30828

The auto generated latest version Firebase uids are alphanumeric with no dashes or underscores. The previous version of Firebase used uuid for uids. So those contained dashes. That said, if you are creating your own users via the admin sdk, you can specify dashes and underscores in the uids. Keep in mind, there is a limit of 128 characters for a uid.

Upvotes: 10

Related Questions