-
I read "API Entities > Account > Attributes > id" in the Mastodon docs and found the following part:
IIUC, |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
The reason it's encoded as a string is to avoid integer overflow in JavaScript. In Mastodon it's pretty much always going to be a number. However there are third-party platforms that emulate the Mastodon API to let people use familiar Mastodon apps with them (e.g. Pleroma, Akkoma, GoToSocial) that have different internal data structures. At the end of the day, you don't need to do any number things like addition or multiplication with the id, so just treating it as an opaque string works. |
Beta Was this translation helpful? Give feedback.
The reason it's encoded as a string is to avoid integer overflow in JavaScript. In Mastodon it's pretty much always going to be a number. However there are third-party platforms that emulate the Mastodon API to let people use familiar Mastodon apps with them (e.g. Pleroma, Akkoma, GoToSocial) that have different internal data structures. At the end of the day, you don't need to do any number things like addition or multiplication with the id, so just treating it as an opaque string works.