Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Convenience library for random base64 strings modeled after my love for Ruby's SecureRandom

License

NotificationsYou must be signed in to change notification settings

patricksrobertson/secure_random.ex

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SecureRandom is an elixir module loosely based on Ruby's SecureRandom.I needed urlsafe, random, base64 strings and UUID generation, so I ported overwhat I needed :).

This gets its random from Erlang'sstrong_rand_bytes/1 and is strongly basedfrom thisgist. I had to remove somethings that didn't make it to Elixir 1.0, and cut the stuff that I do notcurrently have use for.

Will accept PR's to flesh out further.

INSTALL

Add this to your mix.exs:

defpdepsdo[{:secure_random,"~> 0.5"}]end

Fetch this motherlover:

mix deps.get

USAGE

UUID:

SecureRandom.uuid# => "e8bc6fde-3c11-cc2e-903b-745221154d8a"

base64 string:

SecureRandom.base64(8)# => "VsifwaD2HCk="

urlsafe_base64 string:

SecureRandom.urlsafe_base64#=> "WAut546EWdXM3O_9sJGvmQ"

AUTHOR

Brought to you byAdequate Kitchen which is a vague waysaying Patrick Robertson.

LICENSE

Apache 2.0

About

Convenience library for random base64 strings modeled after my love for Ruby's SecureRandom

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors8

Languages


[8]ページ先頭

©2009-2025 Movatter.jp