@alphatr/maze
v1.2.3
Published
random password
Readme
@alphatr/maze
确定性的站点密码生成器。给定主密码、网址和盐值,生成该站点专属的派生密码,保持输入密码的字符类型结构(大写→大写、小写→小写、数字→数字、特殊字符→特殊字符)。
安装
npm install @alphatr/maze使用
import maze from '@alphatr/maze';
const salt = 'your-salt';
const password = maze('masterPassword123!', 'https://github.com', salt);附加导出
import { md5, suffix, punycode } from '@alphatr/maze';
md5('hello'); // md5 hex string
suffix('https://www.tmall.com/login'); // 'www.tmall.com'API
maze(password, link, salt): string
| 参数 | 类型 | 说明 |
|------|------|------|
| password | string | 主密码,字符类型结构会被保留 |
| link | string | 目标网址或域名 |
| salt | string | 盐值,用于个性化生成结果 |
相同的三个参数始终产生相同的输出。link 会被规范化为注册域名(registrable domain),因此 https://www.github.com/login 与 https://github.com 效果相同。
License
MIT
