Security News
GitHub Removes Malicious Pull Requests Targeting Open Source Repositories
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
aho-corasick2
Advanced tools
aho-corasick2 - Aho–Corasick string matching algorithm
$ npm install aho-corasick2
import * as AhoCorasick from 'aho-corasick2';
import AhoCorasick from 'aho-corasick2';
import AhoCorasick = require('aho-corasick2');
var i, len, ref, word;
var ac = new AhoCorasick();
ref = ['say', 'she', 'shr', 'he', 'her', 'h', 'hers', 'his'];
for (i = 0, len = ref.length; i < len; i++)
{
word = ref[i];
ac.add(word, {
word: word
});
}
ac.build_fail();
console.dir(ac, {
depth: null,
colors: true,
});
let actual = ac.search('yasherhs');
/*
{ matches: { h: [ 3, 6 ], she: [ 2 ], he: [ 3 ], her: [ 3 ] },
positions: { '2': [ 'she' ], '3': [ 'h', 'he', 'her' ], '6': [ 'h' ] },
count: { h: 2, she: 1, he: 1, her: 1 },
data:
{ h: [ { word: 'h' } ],
she: [ { word: 'she' } ],
he: [ { word: 'he' } ],
her: [ { word: 'her' } ] } }
*/
console.dir(actual, {
depth: null,
colors: true,
});
ac = new AhoCorasick()
ac.add word, word:word for word in ['say', 'she', 'shr', 'he', 'her']
ac.build_fail()
console.log ac.to_dot()
save output as trie.dot
and
$ dot -Tpng trie.dot -o trie.png
You also need to install GraphViz
Dejian Xu Google+
wikipedia: Aho-Corasick
FAQs
Aho–Corasick string matching algorithm
The npm package aho-corasick2 receives a total of 7 weekly downloads. As such, aho-corasick2 popularity was classified as not popular.
We found that aho-corasick2 demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.