This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

Fity3 is a Twitter snowflake like scheme generator that fits in 53 bits.

Its scheme is:

timestamp | worker_id | sequence
 41 bits  |  8 bits   |  4 bits

Twitter’s snowflake scheme for id generation has a bunch of nice properties. An enormous number of roughly-sorted ids can be created per second in an uncoordinated manner.

However it’s painful working with 64 bit integers in environments that use IEEE 754 floating points for numerics. Particularly JavaScript and the scores for Redis’ sorted sets.

This scheme allows for:

  • 69 years of ids (the same as snowflakes)
  • at most 256 unique id generating workers
  • each worker can produce at most 16 ids per millisecond
  • so at most 4 million ids per second

If you’re building a system in the sweet spot of not being too popular that usage will grow to creating more than 4 million new things a second but you could benefit from uncoordinated incrementing id generation and don’t want to punch yourself in the face every time you request data over a websocket from JavaScript, this scheme might be a useful alternative.

>>> import fity3
>>> f3 = fity3.generator(1)
>>> next(f3)
14127739136
>>> next(f3)
14132125952
>>> next(f3)
14135079168

# convenience to convert to a unix timestamp
>>> fity3.to_timestamp(14135079168)
1413374250

Let’s just hope we won’t be the ones supporting any of these systems in 2079.

Release History

Release History

0.7

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.6

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
python-fity3-0.7.tar.gz (4.0 kB) Copy SHA256 Checksum SHA256 Source Jan 15, 2015

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting