switch (ch) { #if (NGX_WIN32) case '\\': #endif case '/': state = sw_slash; u -= 5; for ( ;; ) { if (u < r->uri.data) { return NGX_HTTP_PARSE_INVALID_REQUEST; } if (*u == '/') { u++; break; } u--; } break;
init_by_lua_block { local process = require"ngx.process" local ok, err = process.enable_privileged_agent() -- 启动特权进程 ifnot ok then-- 检查是否启动成功 ngx.log(ngx.ERR, "failed: ", err) end }
var b58Alphabet = []byte("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz")
func Base58Encode(input []byte) []byte { var result []byte
x := big.NewInt(0).SetBytes(input)
base := big.NewInt(int64(len(b58Alphabet))) zero := big.NewInt(0) mod := &big.Int{}
for x.Cmp(zero) != 0 { x.DivMod(x, base, mod) result = append(result, b58Alphabet[mod.Int64()]) }
ReverseBytes(result)
for _, b := range input { if b == 0x00 { result = append([]byte{b58Alphabet[0]}, result...) } else { break } } return result
}
func Base58Decode(input []byte) []byte { result := big.NewInt(0) zeroBytes := 0 for _, b := range input { if b != b58Alphabet[0] { break } zeroBytes++ } payload := input[zeroBytes:] for _, b := range payload { charIndex := bytes.IndexByte(b58Alphabet, b) result.Mul(result, big.NewInt(int64(len(b58Alphabet)))) result.Add(result, big.NewInt(int64(charIndex))) }