hashids.js:一个小JavaScript库可从数字生成类似YouTube的ID 源码
Hashids是一个小型JavaScript库,可从数字生成类似YouTube的ID。 当您不想向用户公开数据库ID时,请使用它: : 入门 通过以下方式安装Hashids: yarn add hashids (或只使用dist/hashids.js的代码) 在与ESM兼容的环境(Webpack,现代浏览器)中使用 import Hashids from 'hashids' const hashids = new Hashids ( ) console . log ( hashids . encode ( 1 ) ) 在CommonJS环境中使用(通常是Node.js ) const
下载地址
用户评论