Skip to content
master
Go to file
Code

Latest commit

 

Git stats

Files

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

README.md

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

Releases

No releases published

Packages

No packages published

Languages

You can’t perform that action at this time.