Skip to content

Instantly share code, notes, and snippets.

@flori
Created September 26, 2013 11:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save flori/6712769 to your computer and use it in GitHub Desktop.
Save flori/6712769 to your computer and use it in GitHub Desktop.
>> token = Tins::Token.new(bits: 128)
# => "ilTeQJ8zNHGo71cGnZiIfe"
>> token.length
# => 22
>> token.bits
# => 130
>> token = Tins::Token.new(length: 32)
# => "iEqo9h0wIoXJrMrkYZkplrwBjrfTyUma"
>> token.length
# => 32
>> token.bits
# => 190
>> token = Tins::Token.new(bits: 128, alphabet: (?a..?z).to_a)
# => "nvzgvtgrinxbxwgembjghzoverws"
>> token.length
# => 28
>> token.bits
# => 131
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment