@aird/authcode
v1.4.5
Published
Authcode for node/browser
Downloads
39
Readme
@airx/authcode
Examples
Node.js
ENCODE
const {encode} = require('@airx/authcode');
encode('test','key')
// 1df4l6f9CFjMtkqRCi8IHj4hB/0c/HjyEWs0ZweV6jrB
encode('test','key',300)
// 33db1iVqMQUWBO7Tp44qKK+Dtl6cbBG9hNwYP1BKF5U6
DECODE
const {decode} = require('@airx/authcode');
decode('1df4l6f9CFjMtkqRCi8IHj4hB/0c/HjyEWs0ZweV6jrB','key')
// test
浏览器:
引用
<script src="PATH/TO/node_modules/@airx/authcode/dist/authcode.js"></script>
<!-- 或 -->
<script src="//unpkg.com/@airx/authcode/dist/authcode.js"></script>
authcode.encode('test','key')
// 1df4l6f9CFjMtkqRCi8IHj4hB/0c/HjyEWs0ZweV6jrB
authcode.decode('1df4l6f9CFjMtkqRCi8IHj4hB/0c/HjyEWs0ZweV6jrB','key')
// test
License
MIT
通过支付宝捐赠: