A Python generator for the Twitter Snowflake scheme in 61 lines of spacious code.
>>> import snowflake
>>> s = snowflake.generator(1, 1)
>>> print (next(s))
1132805160360349696
>>> print (next(s))
1132805164143611904
>>> print (next(s))
1132805168782512128
# convenience to convert a snowflake to a unix timestamp
>>> snowflake.snowflake_to_timestamp(1132805168782512128)
1413056012