0.0.5 • Published 6 years ago

lesswork-hashids v0.0.5

Weekly downloads
3
License
MIT
Repository
github
Last release
6 years ago

lesswork-hashids

This is a hashids provider for the lesswork-framework.

Installation

npm i --save lesswork-hashids

Register the provider and alias in your config/app.js file.

const providers = [
  ...
  'lesswork-hashids/providers/HashProvider',
];

const aliases = {
  ...
  Hashids: 'Lesswork/Hashids',
};

Configuration

By default your key will be APP_KEY.

You can adjust the configurations by creating the file config/hashids.js

'use strict'

module.exports = {
  key: 'secret',
  length: 5,
  alaphabet: 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890',
};

Usage

See hashids for full usage information.

const Hashids = use('Hashids');

console.log(Hashids.encode(1));
0.0.5

6 years ago

0.0.4

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago