Mastodon's ID format appears to be a custom kind of snowflake (the huge number which appears in the URL for posts).
https://en.wikipedia.org/wiki/Snowflake_ID
https://medium.com/@jitenderkmr/demystifying-snowflake-ids-a-unique-identifier-in-distributed-computing-72796a827c9d
To get an idea of what a snowflake is.