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?
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?
What's the invitation id used for? Would you please elaborate on that?
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.
2 People are following this question.