Skip to content
This repository has been archived by the owner on Mar 27, 2024. It is now read-only.

convert between binary and lua, based on luajit. OpenResty 网络协议基础库

License

Notifications You must be signed in to change notification settings

xiaooloong/lua-resty-struct

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Resty Struct

中文说明

convert between binary and lua, based on luajit.

just use like struct class of Python.

this module is still on developing and do not use it now.

example:

local struct = require 'resty.struct'

local binary, err = struct.pack('HHL', 1, 2, 3)

if not binary then print(err) end

local table, count = struct.unpack('HHL', binary)

if table then
    for i = 1, count do
        print(table[i])
    end
else
    print(count) -- error message instead
end

About

convert between binary and lua, based on luajit. OpenResty 网络协议基础库

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages