Find a file
Phantasm b4b0af11b3
Port build to elixir_make
Fixes build issue on OpenBSD. Previous solution hardcoded "make" which
on OpenBSD doesn't support the GNU-style Makefiles.
2024-10-27 20:09:18 +01: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 first commit 2017-03-27 16:14:16 +08: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 CFLAGS 2023-08-29 20:13:15 +02:00
mix.exs Port build to elixir_make 2024-10-27 20:09:18 +01:00
mix.lock Port build to elixir_make 2024-10-27 20:09:18 +01: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