lua-resty-authcode

Discuzx AuthCode For Lua

$ opm get qiqizjl/lua-resty-authcode

名称

lua-resty-authcode - DiscuzX AuthCode For Lua

状态

此库已准备好投入生产。

概要

一些简单的例子

        http {
            ...
            lua_package_path "/path/to/lua-resty-authcode/lib/?.lua;;";
            ...
        }
        server{
            ...
            content_by_lua_block {
                local authcode = require "resty.authcode"
                local result = authcode:authcode("2617ibqLZGzCIvf/q0HPtQQvPizyRgYTF1bwbQ6KLlncHc8TOUi9D6s","DECODE","123123123")
                ngx.say(result)
            }
            ...
        }

方法

autcode

语法: result = authcode:authcode(str,operation,key,expiry)

  • str

    需要操作的字符串

  • operation

    操作.ENCODEDECODE

  • key

    加密所需的密钥

  • expiry

    加密字符串的过期时间,超出时效将无法解密。默认值 0,永久有效

作者

NaiXiaoXin

许可证

mit

版本