Skip to content

oddminng/elixir-captcha

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

The package can be installed as:

  1. Add captcha to your list of dependencies in mix.exs:
```elixir
def deps do
  [{:captcha, git: "https://github.com/oddminng/elixir-captcha.git", tag: "0.1.0"}]
end
```
  1. Ensure captcha is started before your application:
```elixir
def application do
  [applications: [:captcha]]
end
```

Usage

case Captcha.get() do
  {:ok, text, img_binary } ->
    # save text in session, then send img to client
  {:error, reason} ->
    # log some error
end

About

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

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C 91.1%
  • Elixir 8.0%
  • Makefile 0.9%