{"id":21102187,"url":"https://github.com/renyijiu/gcaptcha","last_synced_at":"2025-10-08T00:55:16.912Z","repository":{"id":56873670,"uuid":"194576541","full_name":"renyijiu/gcaptcha","owner":"renyijiu","description":"A gem to generate the captcha. May be can be used for captcha recognition training","archived":false,"fork":false,"pushed_at":"2020-02-29T17:56:42.000Z","size":38,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-09-03T00:58:44.458Z","etag":null,"topics":["captcha","captcha-generator","captcha-image","captcha-recognition","recaptcha"],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/renyijiu.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-07-01T00:55:02.000Z","updated_at":"2019-07-02T11:37:09.000Z","dependencies_parsed_at":"2022-08-20T22:31:11.438Z","dependency_job_id":null,"html_url":"https://github.com/renyijiu/gcaptcha","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/renyijiu/gcaptcha","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/renyijiu%2Fgcaptcha","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/renyijiu%2Fgcaptcha/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/renyijiu%2Fgcaptcha/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/renyijiu%2Fgcaptcha/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/renyijiu","download_url":"https://codeload.github.com/renyijiu/gcaptcha/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/renyijiu%2Fgcaptcha/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278053885,"owners_count":25922327,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-02T02:00:08.890Z","response_time":67,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["captcha","captcha-generator","captcha-image","captcha-recognition","recaptcha"],"created_at":"2024-11-19T23:54:19.667Z","updated_at":"2025-10-08T00:55:16.881Z","avatar_url":"https://github.com/renyijiu.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GCaptcha\n\n最近涉及验证码识别的工作，所以需要生成一定量的验证码数据进行训练，然后发现Ruby下没有比较方便的Gem可以做到直接生成验证码图片（大部分是与Rails结合的）。所以自己就针对[rucaptcha](https://github.com/huacnlee/rucaptcha)\n抽离出验证码生成的逻辑，形成了这个Gem。验证码较为简单，仅作学习使用。\n\nRecently, it involves the work of verification code identification, so it is necessary to generate a certain amount of verification code data for training, and then find that there is no convenient Gem under Ruby to directly generate verification code pictures (mostly combined with Rails). So I created the Gem according to the logic of [Rucaptcha](https://github.com/huacnlee/rucaptcha).The verification code is simple and just for learning.\n\n## Example\n![](./img/wiyvfca.png)\n\n## Installation\n\n```ruby\ngem 'gcaptcha'\n```\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install gcaptcha\n\n## Usage\n\nYou can write the script to generate the captcha. Example:\n```ruby\nGCaptcha.configure do |config|\n  config.style = :colorful           # default: :colorful, allows: [:colorful, :black_white]\n  config.length = 5                  # default: 5, allows: 3..7\n  config.strike_through = false      # default: true\n  config.outline = false             # default: true, outline style for the hard mode\n  config.batch_nums = 10             # default: 10, batch generate captcha\n  config.img_path = \"path\"           # default: Dir.pwd\n  config.extension_name = :jpg       # default: :jpg, allows: [:jpg, :png, :gif]\nend\n\n# generate one, return the img path\nGCaptcha.generate\n\n# batch generate, return an array of img path\nGCaptcha.batch_generate\n\n# get the config\nGCaptcha.config\n```\n\nAnd also you can use the command, example:\n```ruby\n$ gcaptcha -h\nUsage: GCaptcha [options]\n\nSpecific options:\n    -s, --style [TYPE]               Color style, default: colorful, allows: [colorful, black_white]\n    -l, --length [INTEGER]           Chars length: default 5, allows: [3..7]\n    -t, --[no-]through               strike_through, default: true\n    -u, --[no-]outline               Outline style for the hard mode, default: true\n    -n, --nums [INTEGER]             The nums to batch generate captcha, default: 10\n    -o, --output [STRING]            img output path, default: Dir.pwd\n    -e, --ext_name [TYPE]            image's extension name, allows: [jpg, png, gif], default: jpg\n\nCommon options:\n    -h, --help                       show the help message\n    -v, --version                    Show version\n```\n\n## Thanks\n* [rucaptcha](https://github.com/huacnlee/rucaptcha)\n* [captcha](https://github.com/ITikhonov/captcha)\n\n## Development\n\nAfter checking out the repo, run `bin/setup` to install dependencies and run `rake compile` to make the c extension. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.\n\nTo install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frenyijiu%2Fgcaptcha","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frenyijiu%2Fgcaptcha","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frenyijiu%2Fgcaptcha/lists"}