2.11.0 • Published 7 years ago

am-hashids v2.11.0

Weekly downloads
-
License
UNLICENSED
Repository
-
Last release
7 years ago

am-hashids

Description

A pseudo unique ID generator for AirMap data objects.

Installation

The package is hosted on the AirMap NPM server, Reggie.

%>  npm install --save http://pkg.airmap.io:7777/package/am-hashids/latest

Usage

let AMHashids = require('am-hashids')
let amHashids = new AMHashids.AMHashid()

let aircraft_id = amHashids.aircraft()
// aicraft_id now is something like "aircraft|OAvRdO8s8axbYXHMyeGgZh40eLk".

You can also set what salt string is used by hashids when initializing the instance. The default is 'AirMap is awesome!'

let AMHashids = require('am-hashids')
let amHashids = new AMHashids.AMHashid("My Cool Salt!")

let aircraft_id = amHashids.aircraft()
// aicraft_id is now something like "aircraft|UfIr8O8s8axbYXHMyeGgZh40eLk"

Test

Tests are run with the following commands:

npm test            // Unit tests