Skip to content

monochromegane/mruby-secure-random

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 

mruby-secure-random Build Status

SecureRandom class for mruby.

note: Currently this mrbgem only supports /dev/urandom for random divice.

Usage

SecureRandom.random_bytes
#=> "a\321/\2767\277\362\351\036{\3023=f\035k"
SecureRandom.hex
#=> "28ea6d98ccdfe112a32976d4b7713086"
SecureRandom.base64
#=> "oH1U0zQT492k4Nx0p14izQ=="
SecureRandom.urlsafe_base64
#=> "IMCPOTn291ICuNFKud6Yiw"
SecureRandom.urlsafe_base64(nil, true)
#=> "2fGkw0PnRUsLbPhNyRTIiw=="
SecureRandom.random_number(100)
#=> 74
SecureRandom.uuid
#=> "b5a50f13-3251-45b8-9dc5-27630412fc55"

install by mrbgems

  • add conf.gem line to build_config.rb
MRuby::Build.new do |conf|

    # ... (snip) ...

    conf.gem :github => 'monochromegane/mruby-secure-random'
end

TODO

  • Add OpenSSL::Random to random device.

License

MIT

Author

monochromegane

About

SecureRandom class for mruby.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages