Coder Social home page Coder Social logo

webget_ruby_secure_random's Introduction

WebGet Ruby Gem: secure random number generator interface for Ruby 1.86 backported from 1.8.7

Author

Joel Parker Henderson, [email protected]

Copyright

Copyright the original author; I merely made it into a gem.

License

CreativeCommons License, Non-commercial Share Alike

License

LGPL, GNU Lesser General Public License

This gem is intended for use with Ruby 1.8.6 only.

This gem is a backport of the built-in securerandom method from Ruby 1.8.7.

This library is an interface for secure random number generator which is suitable for generating session key in HTTP cookies, etc.

It supports following secure random number generators.

* openssl
* /dev/urandom

Examples

SecureRandom.hex(10) => "52750b30ffbc7de3b362"
SecureRandom.hex(10) => "92b15d6c8dc4beb5f559"
SecureRandom.hex(11) => "6aca1b5c58e4863e6b81b8"
SecureRandom.hex(12) => "94b2fff3e7fd9b9c391a2306"
SecureRandom.hex(13) => "39b290146bea6ce975c37cfc23"

Examples

SecureRandom.base64(10) => "EcmTPZwWRAozdA=="
SecureRandom.base64(10) => "9b0nsevdwNuM/w=="
SecureRandom.base64(10) => "KO1nIU+p9DKxGg=="
SecureRandom.base64(11) => "l7XEiFja+8EKEtY="
SecureRandom.base64(12) => "7kJSM/MzBJI+75j8"
SecureRandom.base64(13) => "vKLJ0tXBHqQOuIcSIg=="

Examples

SecureRandom.random_bytes(10) => "\016\t{\370g\310pbr\301"
SecureRandom.random_bytes(10) => "\323U\030TO\234\357\020\a\337"

webget_ruby_secure_random's People

Contributors

webget avatar

Stargazers

Sheena Artrip avatar Tim Harrison avatar James wachira avatar Dave Augustine avatar Brian Case avatar  avatar Jessie Johnson avatar Andrew Carpenter avatar Bob Burbach avatar Ray Baxter avatar

Watchers

Ray Baxter avatar Bob Burbach avatar WestEd Information Technology avatar Andrew Carpenter avatar Mark Nutini avatar Jessie Johnson avatar  avatar Brian Case avatar Dave Augustine avatar Tim Harrison avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.