Skip to content

girishramnani/elixir-ksuid

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ksuid

ksuid is a zero dependency Elixir library for generating and parsing KSUIDs.

Read more about ksuid here

How To

iex> Ksuid.generate()
"p9kxW1vWavpdq7VSgbv8piY0nr"

iex> Ksuid.parse("p9kxW1vWavpdq7VSgbv8piY0nr")
{
  :ok,
  %DateTime{calendar: Calendar.ISO, day: 9, hour: 14, microsecond: {0, 0},
    minute: 52, month: 6, second: 34, std_offset: 0, time_zone: "Etc/UTC",
    utc_offset: 0, year: 2017, zone_abbr: "UTC"},
  <<166, 90, 80, 117, 89, 88, 196, 168, 113, 163, 157, 217, 224, 51, 151, 227>>
 }

TODO

  • Generate KSUID
  • Parsing KSUIDS
  • Decode BASE62 method
  • Write tests
  • Write Documentation

Installation

def deps do
  [{:ksuid, "~> 0.1.0"}]
end

Credit

Segmentio/ksuid

About

K-Sortable Globally Unique IDs for elixir

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages