bobusumisu / go-ahocorasick Goto Github PK
View Code? Open in Web Editor NEW:warning: Use https://github.com/BobuSumisu/aho-corasick instead :)
License: MIT License
:warning: Use https://github.com/BobuSumisu/aho-corasick instead :)
License: MIT License
Stack overflow in computeFailLink
when adding a pattern with consecutive zeroes.
Great library, thanks. The following 2 wishes would be easy to implement (and I'll probably do it for my own purposes in a private copy), but they might also be useful in the whole project. The background is an application like an Antivirus scanner or Yara that should avoid detecting itself or being detected as malware by another AV by mistake. So the actual search patterns should not appear directly in the application (this is not a cryprographic need as with passwords, but less strict, a false-detection-prevention). A trie is a perfect construct to avoid these false positives - but as you need to build the trie first, the actual byte patters appear at this stage in memory, and Go makes it hard to really wipe them afterwards because of GC. The easiest way would be to use pre-compiled tries, so the trie building happens in a seperate program once, and just a byte representation of the trie is used by the final application. To do this, a simple marshaling and unmarshaling of the Trie struct suffices, but as the fields are private, it can't be done from outside the library, AFAIK (maybe through reflection, but better not think about it... I think even this can only read, and not write private fields).
The second problem occurs if you have several match patterns; currently, you still need to finally compare the found matches with the actual patterns. To avoid this, it should be possible to give (or get) an additional integer identifier when adding patterns, which is also returned in the actual Matches structure, so the final app needs only compare those. The final app of course must know what of these IDs map to which patterns, but can do so without containing the actual patterns in its code. Note: the fact that in case of an actual match, an additional detection by another AV actually is not an issue, because it would then of course not be a false positive anymore :-)
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.