1.0.5 • Published 1 year ago

@vukovicpavle/orange-verification-code v1.0.5

Weekly downloads
-
License
ISC
Repository
-
Last release
1 year ago

🍊 Verification code

This is a simple verification code generator. Supports numeric and alphanumeric verification codes.

Installation

npm install @vukovicpavle/orange-verification-code

Usage

import {
  generateAlphanumericCode,
  generateNumericCode,
} from "@vukovicpavle/orange-verification-code";

const numericCode = generateNumericCode(6); // 123456
const alphanumericCode = generateAlphanumericCode(6, "upper"); // ABCDEF

API

generateNumericCode(length?: number)

Generates a numeric verification code.

Parameters

NameTypeDescriptionRequiredDefault
lengthnumberThe length of the code.No4

Returns

TypeDescription
stringThe generated code.

generateAlphanumericCode(length?: number, letterCase?: string)

Generates an alphanumeric verification code.

Parameters

NameTypeDescriptionRequiredDefault
lengthnumberThe length of the code.No4
letterCasestringThe case of the code. "mixed", "upper" or "lower".No"mixed"

Returns

TypeDescription
stringThe generated code.
1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago