sonyflake
A Crystal port of sony/sonyflake
Installation
- Add the dependency to your
shard.yml
:
dependencies:
sonyflake:
github: BecauseOfProg/sonyflake
- Run
shards install
Usage
require "sonyflake"
settings = Sonyflake::Settings.new(start_time: Time.utc(2020, 1, 1), machine_id: 1)
sonyflake = Sonyflake.new_sonyflake(settings)
puts sonyflake.next_id # => 302603879411875841
puts Sonyflake.get_instance.next_id # => 302603879411941377
Contributing
- Fork it (https://github.com/BecauseOfProg/sonyflake/fork)
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request
Contributors
- Whaxion - creator and maintainer