RCaptcha is a simple Ruby library for generating CAPTCHA images.
Add this line to your application's Gemfile:
gem 'rcaptcha'
And then execute:
$ bundle
Or install it yourself as:
$ gem install rcaptcha
Generating CAPTCHA images is easy, simply give it the 'answer' and it will turn it into an image byte string. Image will be encoded in JPEG format.
# Image will be a distorted version of "29345571"
RCaptcha.generate '29345571'
- Fork RCaptcha
- 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 new Pull Request