UNPKG

@sumor/short-id

Version:

This is a short-id library for Node.js and the browser. You can easily use it to generate a short id from number.

17 lines (15 loc) 441 B
import encodeFunc from './encode.js' import decodeFunc from './decode.js' const decode = (value, rule) => { rule = rule || '0123456789abcdefghigklmnopqrstuvwxyzABCDEFGHIGKLMNOPQRSTUVWXYZ' return decodeFunc(value, rule) } const encode = (value, rule) => { rule = rule || '0123456789abcdefghigklmnopqrstuvwxyzABCDEFGHIGKLMNOPQRSTUVWXYZ' return encodeFunc(value, rule) } export { decode, encode } export default { decode, encode }