hashids.js
hashids.js 介绍
hashids.js 一个小型JavaScript库,可以从数字生成类似YouTube的ID。 当您不希望向用户公开数据库ID时使用它。
安装
yarn add hashids
#or
bower install hashids
#or
jam install hashids
使用
const hashids = new Hashids()
const id = hashids.encode(1,2,3) // o2fXhV
const numbers = hashids.decode(id) // [1,3]
网站地址:https://hashids.org/javascript
GitHub:https://github.com/niieani/hashids.js
网站描述:数字生成类似YouTube的ID的js库