JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 2246
  • Score
    100M100P100Q144839F
  • License ISC

A cryptographically secure pin code generator

Package Exports

  • secure-pin

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (secure-pin) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

A simply and cryptographically secure way to generate PIN codes. Has no dependencies and includes Typescript definitions.

Installation

From NPM

npm install secure-pin

Typescript

import * as SecurePIN from "secure-pin";

Javascript

var SecurePIN = require("secure-pin");

Usage

Signature

SecurePIN.generatePin(length : number, callback: (pin: string) => void);
  • The length can be any number > 0

Example

SecurePIN.generatePin(4, (pin)=> {
    console.log("Pin: " + pin);
})

Returns

Pin: 1234