@airx/swagger-hook

Authcode for node/browser

Usage no npm install needed!

<script type="module">
  import airxSwaggerHook from 'https://cdn.skypack.dev/@airx/swagger-hook';
</script>

README

@airx/authcode

npm npm npm

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

通过支付宝捐赠:

qr