jeeng-utils
v1.0.2
Published
A collection of util helper functions for jeeng projects
Downloads
4
Readme
jeeng-utils
This package is a collection of various helper functions for Jeeng applications
encodeId / decodeId
description
These functions use the (hashids
)[https://www.npmjs.com/package/hashids] package in order to encode/decode ids (long integers).
There is some wrapper code to handle edge cases.
usage
const { decodeId, encodeId} = require('jeeng-utils')
const salt = 'Some random string 1234SDG@5tHHW@@@@trg@!'
const num = Math.floor(Math.random() * 100000)
const encoded = encodeId(salt, num)
const decoded = decodeId(salt, encoded)