Skip to content

barmat/resty-hyperscan-ffi

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

resty-hyperscan-ffi

intel hyperscan luaffi bind

QuickStart

apt-get install libhyperscan-dev

make tool

g++ -O3 -o hs_scan hs_scan.cpp $(pkg-config --cflags --libs libhs)

./hs_scan -h

txt db example

0:/st[A-Z]r/HV

1:/str2/HV

make lib

g++ -shared -fPIC -O3 -o libhscan.so hs_scan.cpp $(pkg-config --cflags --libs libhs) -fopenmp

cp libhscan.so to openresty path -- "/opt/openresty/nginx/lib/libhscan.so"

use cmake

mkdir build

cd build

cmake -DCMAKE_BUILD_TYPE=Release ..

make

run

local modhs = require "hs_scan"

local m = modhs.match("updatexml user_tables", "/opt/sql_hs.bin")

ngx.log(ngx.DEBUG, "count ", m.count)

ngx.log(ngx.DEBUG, "id 1 ", m.groups[0].id)

ngx.log(ngx.DEBUG, "id 2 ", m.groups[1].id)

About

intel hyperscan openresty luaffi bind

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 83.9%
  • CMake 8.4%
  • Lua 7.7%