Captcha (captcha_c v0.1.2)

Copy Markdown

Improved captcha generation library that works reliably in both development and production environments.

This version uses System.cmd instead of Port.open to avoid issues with process management, working directory, and environment variables that can cause problems in production deployments.

Summary

Functions

Generates a captcha image and returns the text and image data.

Functions

get()

Generates a captcha image and returns the text and image data.

Returns:

  • {:ok, text, image_data} - Success with 5-character text and GIF image data
  • {:error, reason} - If generation fails

Examples

iex> {:ok, text, image_data} = Captcha.get()
iex> is_binary(text)
true
iex> byte_size(text)
5
iex> is_binary(image_data)
true