Package Exports
- serial-key-generator
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 (serial-key-generator) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Synopsis
This is a simple package to generate (pseudo) random strings of specified length
separated into "blocks" of specified blockLength
s by specified separator
characters. This makes this package suitable for generating license or product or serial keys.
The similar looking characters (and numbers) I, 1, 0 and O are always left out of the generated strings to avoid confusion.
Note that the generated keys are just random strings and there's no provision to check their validity cryptographically.
Installation
From npm registry:
npm i serial-key-generator
OR
Directly from gist:
npm i -S gist:ed14ef9bcae9b9188833e583313b0d21
Usage Example
The package exposes a single function with signature generate(length = 16, separator = '-', blockLength = 4)
which may be used as follows:
const serial = require("generate-serial-key")
serial.generate() // Outputs 'AG8D-ZGYG-A8YV-PVMK'
serial.generate(20, "_", 5) // Outputs 'UL3MV_BTPXB_MBEU9_QK3MC'
Acknowledgement
https://gist.github.com/RobK/8172cd2a358efeca715e