crystal-randomorg
RandomOrg
Access true random numbers through the random.org API!
See https://random.org/ for the specifics of the random.org services and their API.
Installation
-
Add the dependency to your
shard.yml
:dependencies: randomorg: github: your-github-user/randomorg
-
Run
shards install
Usage
require "randomorg"
Before you can get your random numbers, you will need an API key. You can request one from here: https://api.random.org/api-keys/beta
Then you need to configure the module with this key in order to use the service:
RandomOrg.configure do |config|
config.api_key = "YOUR_API_KEY"
end
After which you can use it in pretty much the same way as you would the SecureRandom library:
> RandomOrg.random_number(100)
=> 78
> RandomOrg.base64
=> "r1nwqJksqKacn26UBI1GkQ=="
Development
Nothing special to think about.
Contributing
- Fork it (https://bitbucket.org/janlindblom/crystal-randomorg)
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request
Contributors
- Jan Lindblom - creator and maintainer
License
The shard is available as open source under the terms of the MIT License.
Use of the random.org service and API is subject to their Terms and Conditions: https://www.random.org/terms/
crystal-randomorg
- 0
- 0
- 0
- 0
- 1
- almost 4 years ago
- June 4, 2020
MIT License
Mon, 06 May 2024 00:31:37 GMT