Finger

Finger is a verification library to prove hommaannnnnness of a user.

Finger achieves this by showing pictures of N hands holding up random fingers and asking users to verify how many fingers am I holding up, which is a task our machine friends suck at!

alt textalt text

More detailed blog post

Dependencies

This library requires the awesome imagemagick software to be installed on your machine. It is not version dependant.

Improvements

Lot's of imporevements to be made to the library itself. First elixir and hex package, please bare with me :)

Installation

  1. Install from Hex
def deps do
[
{:finger, "~> 0.1.0"}
]
end
  1. Create an action to display the image
defmodule Elxsy.TestController do
use Elxsy, :controller
...
def test(conn, _params) do
...
render(conn, ....)
end
def finger(conn, _params) do
{answer, image} = Finger.generate()
# store the answer in session or somwhere else on the server side
conn
|> put_session(:fingers, answer)
|> put_resp_content_type("image/jpeg")
|> send_resp(200, image)
end
def verify(conn, params) do
answer = get_session(conn, :fingers)
delete_session(conn, :fingers)
if params["fingers"] === answer do
...
end
end
  1. Add to your routes
get "/test/finger.jpg", TestController, :finger
  1. Add to your template for test method
...
<img src="<%= Routes.test_path(@conn, :finger) %>" />
<input type="number" name="fingers" placeholder="Please tell me how many fingers are shown in each hand" required="true" />
...
  1. Verify for the answer in form submission with the verify like an example.

Contribution to the library

Please fork and make necessary changes, raise a pull request.

Contribution to the picture stack

More the merrier!

Bugs or Issues