authcode

discuz authcode function for nodejs

Usage no npm install needed!

<script type="module">
  import authcode from 'https://cdn.skypack.dev/authcode';
</script>

README

authcode

这是一个discuz authcode函数的NodeJS实现

安装

npm install authcode

使用说明

var auth = require('authcode');
/**
 * authcode
 * @param  str       需要加密/解密的字符串
 * @param  operation 加密['ENCODE']/解密['DECODE']
 * @param  key       加密密钥
 * @param  expiry    过期时间(0为不过期,默认为0)
 * @return           加密过的字符串
 */
auth(string,operation,key,expiry);