Reputation: 195
I am making a database in which my algorithm only accepts queries from users with telegram id length of 9.
user_id: 123456789;
length = user_id.length;
display(length);
OUTPUT: 9
Are there telegram user ids of length lesser than 9?
Can anybody suggest something, so that i can update my algorithm to length of that ids too.
Upvotes: 9
Views: 17228
Reputation: 1
Today I saw two guys who have a double-digit ID
@Ruslan_Ozdoev : 25 @Akhmedoff_J : 55
(6 Digit) @MarkusRa : 914597
Upvotes: 0
Reputation: 7975
You can refer to Contact section of API document.
it has at most 52 significant bits, so a 64-bit integer or double-precision float type are safe for storing this identifier.
There have no known limit of user ID, but I know there have some user have less than 9 digits ID.
For instance, @MarkusRa have 6-digits ID.
The maximum length I have seen is 9 digits, and starts with 6
, it seems to increase by time, maybe it will have 10 digits soon
Upvotes: 5
Reputation: 21
I have seen 10 digits user ID starts with 5, it exceeds int32 max value.
Upvotes: 2
Reputation: 5038
Unique identifier for this chat. This number may be greater than 32 bits and some programming languages may have difficulty/silent defects in interpreting it. But it is smaller than 52 bits, so a signed 64 bit integer or double-precision float type are safe for storing this identifier.
Upvotes: 11