Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IDs should be i64s, not ints. #18

Open
km19809 opened this issue Mar 22, 2023 · 0 comments
Open

IDs should be i64s, not ints. #18

km19809 opened this issue Mar 22, 2023 · 0 comments

Comments

@km19809
Copy link

km19809 commented Mar 22, 2023

According to doc, IDs and file sizes are at most 52 bits.

This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this identifier.

So they should be i64, not an int(32 bits integer).

The full list:

  1. User.id
  2. Chat.id
  3. Message.migrate_to_chat_id
  4. Message.migrate_from_chat_id
  5. Animation.file_size
  6. Audio.file_size
  7. Document.file_size
  8. Video.file_size
  9. Voice.file_size
  10. Contact.user_id
  11. UserShared.user_id
  12. ChatShared.user_id
  13. File.file_size
  14. ChatJoinRequest.user_chat_id
  15. ResponseParameters.migrate_to_chat_id

Should I make a PR for this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant