question

Xiumo avatar image
Xiumo asked

How can I get a short invitation id created by PlayFab ID

For in game invitation, I want to generate a unique short string ID by ueser's PlayFab ID, the ID is 8~10 digit numeric. Is there any solution?

1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Citrus Yan avatar image Citrus Yan commented ·

What's the invitation id used for? Would you please elaborate on that?

0 Likes 0 ·

1 Answer

·
bindin00 avatar image
bindin00 answered

No

Going from Base 16 -> Base 10 reduces the total amount of encoding symbols (you can no longer use A-F), so the length of a Base10 encoded PlayFabID would be longer than before, which is not what you want.

A 16 character PlayFabID would require 20 digits


If you don't actually care about using only digits, you could shorten the length of your encoded string by increasing the total number of encoding symbols

Encoding using Base64 would still require 11 characters (and it would include both lower and uppercase letters, digits, symbols etc)

Encoding using Base36 would still require 13 characters (only using 0-9, and A-Z)

If you expect the user to enter the ID themselves, you are probably going to want to remove characters that can be confusing (0, O), (1, I), and since this is reducing the amount of encoding symbols you are using, this is is only going to make the encoded string longer.

So the best you are going to get is around a length of 13 characters, and I am not sure how much of an improvement that is over just using the 16 character PlayFabID to begin with.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.