No description
  • C 90.7%
  • Elixir 8.7%
  • Makefile 0.6%
Find a file
Haelwenn 7846058157 Merge branch 'makefile' into 'master'
Makefile: Use CPPFLAGS

See merge request pleroma/elixir-libraries/elixir-captcha!13
2025-07-09 13:42:07 +00:00
config Fix warnings on modern Elixir 2024-06-27 12:10:01 -04:00
lib Use System.cmd instead of Port.open 2019-12-27 13:23:38 +07:00
priv use absolute bin path 2017-03-27 16:39:12 +08:00
src Fix headers path to avoid needing -I./src 2024-11-27 23:23:35 +01:00
test Use System.cmd instead of Port.open 2019-12-27 13:23:38 +07:00
.formatter.exs Add formatter.exs 2019-11-10 15:22:04 +03:00
.gitignore use absolute bin path 2017-03-27 16:39:12 +08:00
.gitlab-ci.yml Update CI image to Elixir 1.13 2024-06-27 12:10:01 -04:00
LICENSE first commit 2017-03-27 16:14:16 +08:00
Makefile Makefile: Use CPPFLAGS 2025-07-08 21:14:29 +02:00
mix.exs Mix: Remove docs stuff 2024-11-29 15:54:17 +04:00
README.md allow set receive timeout. 2018-07-30 13:49:39 +08:00

Captcha

This is a Elixir lib for generating captcha. No dependencies. It drawing captcha image with C code. No ImageMagick, No RMagick.

C code come from: https://github.com/huacnlee/rucaptcha

Installation

If available in Hex, the package can be installed as:

  1. Add captcha to your list of dependencies in mix.exs:
```elixir
def deps do
  [{:captcha, "~> 0.1.0"}]
end
```
  1. Ensure captcha is started before your application:
```elixir
def application do
  [applications: [:captcha]]
end
```

Usage

# allow customize receive timeout, default: 10_000
case Captcha.get() do
  {:ok, text, img_binary } ->
    # save text in session, then send img to client
  {:timeout} ->
    # log some error
end