Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/client9/snowflake2time
Converts twitter snowflake ids to UTC timestamps (unix epoch seconds or milliseconds) and back in php and python
https://github.com/client9/snowflake2time
Last synced: about 1 month ago
JSON representation
Converts twitter snowflake ids to UTC timestamps (unix epoch seconds or milliseconds) and back in php and python
- Host: GitHub
- URL: https://github.com/client9/snowflake2time
- Owner: client9
- License: other
- Created: 2012-06-05T14:13:41.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2023-08-13T17:38:30.000Z (over 1 year ago)
- Last Synced: 2024-05-08T17:15:05.657Z (6 months ago)
- Language: PHP
- Homepage:
- Size: 10.7 KB
- Stars: 50
- Watchers: 3
- Forks: 20
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
snowflake2time
==============Converts Twitter snowflake ids to UTC timestamps (unix epoch seconds
or milliseconds) and back.Hi. I don't use this anymore, so pull requests to fix things up and/or become an owner are very welcome! --nickg 2018
## Snowflake Layout
```
1 sign bit -- not used, always 0?
41 bits (milliseconds since epoch) - 1288834974657L
5 bits datacenter id
5 bits machine id
12 bit sequence number
```Currently in php and python. Other languages welcome!
## The Snowflake algorithm:
https://github.com/twitter/snowflake/blob/master/src/main/scala/com/twitter/service/snowflake/IdWorker.scala
Twitter IDs, JSON and Snowflake 2011-06-26
https://dev.twitter.com/docs/twitter-ids-json-and-snowflakeOther Snowflake news:
http://groups.google.com/group/twitter-development-talk/browse_thread/thread/5152a34a8ae6ccb6/1edb5cd6002f6499?pli=1
https://dev.twitter.com/blog/direct-messages-going-snowflake-on-sep-30-2011