Skip to content

lessworkjs/hashids

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Lessworkjs/Adonisjs Hashids

This is a hashids provider for the lessworkjs and adonisjs frameworks.

Installation

npm i @lessworkjs/hashids

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

const providers = [
  ...
  '@lessworkjs/hashids/providers/HashProvider',
];

Configuration

By default your key will be APP_KEY.

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

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

Usage

See hashids for full usage information.

const Hashids = use('Hashids');

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

About

Hashids provider for lessworkjs or adonisjs.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published