LO
xid for crystal lang
Resources:
Installation
- Add the dependency to your
shard.yml:
dependencies:
xid:
github: lost22git/xid.cr- Run
shards install
Usage
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
Development
Run tests
crystal spec --progressRun bench
crystal run --release --progress bench/xid_bench.crContributing
- 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
Contributors
- lost - creator and maintainer
On this page
Languages
Crystal93.8%Just6.2%
MIT License
Created April 30, 2024
Updated May 3, 2024