{"id":18345360,"url":"https://github.com/hunter-ji/coolcaptcha","last_synced_at":"2025-12-15T00:55:26.112Z","repository":{"id":168275902,"uuid":"643528329","full_name":"hunter-ji/coolCaptcha","owner":"hunter-ji","description":"A cool captcha.Customizable themes to match website style and enhance user experience.🥳🥳🥳","archived":false,"fork":false,"pushed_at":"2023-06-08T13:56:57.000Z","size":169,"stargazers_count":16,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-21T20:46:44.060Z","etag":null,"topics":["captcha","captcha-generator","go","go-captcha","golang"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hunter-ji.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-05-21T13:03:51.000Z","updated_at":"2024-10-26T14:22:59.000Z","dependencies_parsed_at":null,"dependency_job_id":"35845739-aadf-4e58-b8a0-6be19db691fa","html_url":"https://github.com/hunter-ji/coolCaptcha","commit_stats":null,"previous_names":["kuari/coolcaptcha","hunter-ji/coolcaptcha"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hunter-ji%2FcoolCaptcha","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hunter-ji%2FcoolCaptcha/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hunter-ji%2FcoolCaptcha/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hunter-ji%2FcoolCaptcha/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hunter-ji","download_url":"https://codeload.github.com/hunter-ji/coolCaptcha/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247457209,"owners_count":20941900,"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","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","go","go-captcha","golang"],"created_at":"2024-11-05T21:08:02.048Z","updated_at":"2025-10-27T03:03:34.481Z","avatar_url":"https://github.com/hunter-ji.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n\u003cimg src=\"./assets/theme_default_cool.png\" alt=\"logo\" width=\"300\" height=\"120\" style=\"border-radius: 12px;\" /\u003e\n\u003c/p\u003e\n\n\u003ch3 align=\"center\"\u003eCoolCaptcha\u003c/h3\u003e\n\n## Info\n\n`CoolCaptcha` is a graphic captcha that I think is cool.The library makes it quick and easy to generate base64 data for captcha images, and it can be configured to customize the style to match the style of the product.\n\n\n\nlanguages: [简体中文](https://github.com/Kuari/coolCaptcha/blob/main/README.zh-CN.md) English\n\n\n\n## Case\n\n![theme_default_cool](./assets/theme_default_cool.png) ![theme_default_random](./assets/theme_default_random.png)\n\n![theme1_cool](./assets/theme1_cool.png) ![theme1_random](./assets/theme1_random.png)\n\n![theme2_cool](./assets/theme2_cool.png) ![theme2_random](./assets/theme2_random.png)\n\n\n\n\n\n## Install\n\n```go\ngo get github.com/Kuari/coolCaptcha\n```\n\n\n\n## Usage\n\n### Quiuick Start Guide\n\n```go\npackage main\n\nimport (\n\t\"github.com/Kuari/coolCaptcha\"\n)\n\nfunc main() {\n\timageBase64Data, code, err := coolCaptcha.New().GenerateImage()\n}\n```\n\n### Custom configuration\n\n```go\npackage main\n\nimport (\n\t\"github.com/Kuari/coolCaptcha\"\n)\n\nfunc main() {\n\toptions := []coolCaptcha.Options{\n\t\tcoolCaptcha.SetBackgroundHexColor(\"#c4e1f6\"),                            // set the background color of the picture\n\t\tcoolCaptcha.SetFontHexColor(\"#312E2E\"),                                  // set font color\n\t\tcoolCaptcha.SetLineHexColors([]string{\"#f596a1\", \"#fadeeb\", \"#f9c975\"}), // to set the line color, 3 bars are randomly selected from it, so this parameter sets at least 3 values\n\t\tcoolCaptcha.SetWidth(300),                                               // set the width of the image\n\t\tcoolCaptcha.SetHeight(120),                                              // set the height of the image\n\t\tcoolCaptcha.SetCodeType(coolCaptcha.NumericCharacters),                  // set the type of authentication characters, there are three types: UppercaseEnglishCharacters, NumericCharacters, and MixedCharacters\n\t\tcoolCaptcha.SetDevMode(true),                                            // Set the development module, which is suitable for saving base64 data as an image during development, so that you can easily view the generated effect\n\t}\n\n\timageBase64Data, code, err := coolCaptcha.New(options...).GenerateImage()\n}\n```\n\n### Custom verification codes\n\nYou can generate images from a captcha that you generate yourself.\n\n```go\npackage main\n\nimport (\n\t\"github.com/Kuari/coolCaptcha\"\n)\n\nfunc main() {\n\t// The customCode method only supports 4-character English and numbers,\n\t// when passing in English, it will be capitalized and then used, so when using custom characters, the output code is capitalized, please pay attention when verifying\n\t// all capitalization is intended to reduce the ambiguity of English letters and numbers\n\timageBase64Data, code, err := coolCaptcha.New().CustomCode(\"cool\").GenerateImage()\n}\n```\n\n\n\n## Q\u0026A\n\n### 1. Can the default font be free for commercial use?\n\nThe default font uses [blowbrush](https://www.dafont.com/blowbrush.font), which is free for both personal and commercial use.\n\nAnd custom font settings will be opened in the future, so please stay tuned.\n\n### 2. Can OCR be cracked?\n\n`CoolCaptcha` has the risk of being cracked by OCR, please use it in combination with specific scenarios.\n\n### 3. How to avoid the confusion between English letters and numbers?\n\n`CoolCaptcha` capitalizes all English, so it is clear between English letters and numbers. You can also use `SetCodeType` to set the authentication character to be pure English characters or pure numbers.\n\n### 4. Why was this project developed?\n\nIn some specific scenarios, graphics captcha is required, but several problems are found. First of all, most of the current captcha is similar with each other, I think the user experience is very important, designers and front-end hard work products, it will be strange to have a different style of graphic captcha. Secondly, Go's graphics captcha library is a bit small, and I worked with a Java development engineer before, and I envy the ability to quickly output a graphics captcha. Therefore, it is engaged.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhunter-ji%2Fcoolcaptcha","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhunter-ji%2Fcoolcaptcha","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhunter-ji%2Fcoolcaptcha/lists"}