daurnimator / mmdblua Goto Github PK
View Code? Open in Web Editor NEWMaxmind database parser for lua
License: MIT License
Maxmind database parser for lua
License: MIT License
hi buddy, you wrote a very nice useful module, thank!
but is there any way that i can integrate your module without luarocks?
I have system where I have ffi.abi('le')
false, but mmdb file has such endian.
So as result I have wrong value in record_size.
I suggest detect endian based on e.g. IP version format. It can be either 6 or 4.
Care to make a luarocks release?
At the moment we use some hacky routines to read/write doubles: https://github.com/daurnimator/mmdblua/blob/f0644b7478ec91fd8a7d85a9f0f259f444ba20cd/IEEE-754.lua
As well as some simple routines to read ints:
Line 179 in f0644b7
Lua 5.3 brings with it new function string.unpack
which can be used to tidy this up.
compat-5.3 can be used to bring this functionality to lua 5.1 and 5.2. Preferably we stay compatible with Roberto's struct library too.
I prefer if function returns error instead raise Lua errors.
E.g. if i get info from untrasted source I want return either info or error message.
Now I have to use pcall
for such thing.
I like way how it was implemented in cjson
library.
It just provide 2 module cjson
and cjson.safe
.
Suggestions for the right way to do this? I think that file:seek() would work.
I tried the module on GeoIP2-Anonymous-database from maxmind (tried couple of latest versions)
i got assert error, "wrong key type" on the line below.
https://github.com/daurnimator/mmdblua/blob/master/mmdb/init.lua#L258
https://en.wikipedia.org/wiki/IPv6#IPv4-mapped_IPv6_addresses
e.g. ::ffff:192.0.2.128
It would be nice if you would consider adding proper source release tarballs,
as GitHub auto-generated tarballs are not immutable. This is an issue [1] for
operating systems creating packages for mmdblua. Thanks in advance.
[1] https://marc.info/?l=openbsd-ports&m=151973450514279&w=2
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.