Skip to content

fduseless/captchan

Repository files navigation

CaptchaN

Captcha for Node js, which generates captcha image by Rust.

Feature

  • Native Package base on Rust.
  • Simple, Easy to use;
  • High performance.

Install

Install captchan with yarn:

yarn add @fduseless/captchan

Usage

import { createImage, Format } from '@fduseless/captchan';

// with default value
const {text, image} = createImage();

// with options
const {text, image} = createImage(
    len=4, // num of character
    difficulty=5, // range [1,10]
    line=true, // draw bezier curve or ellipse
    noise=false, // whether add gaussian noise
    format=Format.PNG, // PNG | JPG | JPEG | WEBP
);

Thanks

rucaptcha