Class Captcha

Generates a Captcha Image

Constructors

  • Creates an instance of Captcha.

    Parameters

    • _h: number = 250

      The height of the captcha image

    Returns Captcha

Properties

_canvas: Canvas
_h: number = 250

The height of the captcha image

_value: string = ""

Accessors

  • get JPEGStream(): JPEGStream
  • Gets the JPEG stream of the captcha image

    Returns JPEGStream

    The JPEG stream of the captcha image

  • get PNGStream(): PNGStream
  • Gets the PNG stream of the captcha image

    Returns PNGStream

    The PNG stream of the captcha image

  • get dataURL(): string
  • Gets the data URL of the captcha image

    Returns string

    The data URL of the captcha image

  • get value(): string
  • Gets the value of the captcha

    Returns string

    The value of the captcha

Methods

  • Private

    Clears the canvas

    Parameters

    • ctx: CanvasRenderingContext2D

      The canvas rendering context

    Returns void

  • Private

    Draws random lines on the canvas

    Parameters

    • ctx: CanvasRenderingContext2D

      The canvas rendering context

    Returns void

  • Private

    Draws random circles on the canvas

    Parameters

    • ctx: CanvasRenderingContext2D

      The canvas rendering context

    Returns void

  • Private

    Draws the captcha text on the canvas

    Parameters

    • ctx: CanvasRenderingContext2D

      The canvas rendering context

    Returns void

  • Private

    Generates the captcha image

    Returns void

Generated using TypeDoc