Skip to content

crash2burn/lexical_uuid.cr

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

lexical_uuid.cr

This is a port of the ruby library lexical_uuid. It provides a way to go to and from ORDERED v1 UUIDS.

Installation

Add this to your application's shard.yml:

dependencies:
  lexical_uuid:
    github: crash2burn/lexical_uuid.cr

Usage

require "lexical_uuid"

uuid = LexicalUUID::UUID.new
puts uuid.to_guid #=> "00056e19-aa1e-2c81-33b7-7ccf993414bd"

from_bytes = LexicalUUID::UUID.new(uuid.to_bytes)
puts from_bytes.to_guid #=> "00056e19-aa1e-2c81-33b7-7ccf993414bd"

from_guid = LexicalUUID::UUID.new(uuid.to_guid)
puts from_guid.to_guid #=> "00056e19-aa1e-2c81-33b7-7ccf993414bd"

Contributing

  1. Fork it ( https://github.com/crash2burn/lexical_uuid.cr/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

Thanks

Contributors

About

a port of Ruby's lexical_uuid

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published