API DOC
- Add the dependency to your
shard.yml
:
dependencies:
xid:
github: lost22git/xid.cr
- Run
shards install
require "xid"
# generate a Xid
xid = Xid.generate
# xid to string
str = xid.to_s
# parse string to Xid
xid2 = Xid.from_s str
# xid as read only bytes view
bytes = xid2.as_bytes
# generate Xid by bytes
xid3 = Xid.from_bytes bytes
# resolve time from xid
p! xid3.time
# print xid debug info
xid3.debug
crystal run --release --progress bench/xid_bench.cr
- Fork it (https://github.com/lost22git/xid.cr/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
- lost - creator and maintainer