http
名称 | 说明 |
---|
luwak.http.get(url, config) | 发起 HTTP GET 请求 |
luwak.http.post(url, data, config) | 发起 HTTP POST 请求 |
random
名称 | 说明 |
---|
luwak.random.guid() | 生成全局唯一标识符 |
luwak.random.uuid() | 生成通用唯一标识符 |
luwak.random.integer(from, to) | 生成随机数值 |
luwak.random.secret(length) | 生成包含字母、数字、特殊字符的随机字符串 |
luwak.random.numeric(length) | 生成仅包含数字的随机字符串 |
luwak.random.alphanumeric(length) | 生成包含字母和数字的随机字符串 |
crypto
名称 | 说明 |
---|
luwak.crypto.aesEncrypt(secretKey, plaintext) | AES 加密 |
luwak.crypto.aesDecrypt(secretKey, encryptedString) | AES 解密 |
passwordHash() 使用的算法、cost 和盐值作为散列的一部分返回。
所以验证散列值的所有信息都已经包含在内。
这使 passwordVerify() 函数验证的时候,不需要额外储存盐值或者算法的信息。
hash
名称 | 说明 |
---|
luwak.hash.md5(str) | md5 |
luwak.hash.sha1(str) | sha1 |
luwak.hash.sha256(str) | sha256 |
luwak.hash.passwordHash(password) | 生成散列后的密码 |
luwak.crypto.passwordVerify(password, hash) | 验证密码是否和散列值匹配 |
log
名称 | 说明 |
---|
log.error() | 写日志文件 |
log.warn() | 写日志文件 |
log.info() | 写日志文件 |
log.debug() | 写日志文件 |