Security News
The Push to Ban Ransom Payments Is Gaining Momentum
Ransomware costs victims an estimated $30 billion per year and has gotten so out of control that global support for banning payments is gaining momentum.
levenshtein-edit-distance
Advanced tools
Readme
Levenshtein edit distance (by Vladimir Levenshtein). No cruft. Real fast.
npm:
$ npm install levenshtein-edit-distance
$ component install wooorm/levenshtein-edit-distance
$ bower install levenshtein-edit-distance
Duo:
var levenshtein = require('wooorm/levenshtein-edit-distance');
var levenshtein = require('levenshtein-edit-distance');
levenshtein('levenshtein', 'levenshtein'); // 0
levenshtein('sitting', 'kitten'); // 3
levenshtein('gumbo', 'gambol'); // 2
levenshtein('saturday', 'sunday'); // 3
/* Case sensitive! */
levenshtein('DwAyNE', 'DUANE') !== levenshtein('dwayne', 'DuAnE'); // true
/* Insensitive: */
levenshtein('DwAyNE', 'DUANE', true) === levenshtein('dwayne', 'DuAnE', true); // true
/* Order insensitive */
levenshtein('aarrgh', 'aargh') === levenshtein('aargh', 'aarrgh'); // true
Install:
$ npm install --global levenshtein-edit-distance
Use:
Usage: levenshtein-edit-distance [options] word word
Levenshtein edit distance. No cruft. Real fast.
Options:
-h, --help output usage information
-v, --version output version number
-i, --insensitive ignore casing
Usage:
# output distance
$ levenshtein-edit-distance sitting kitten
# 3
# output distance from stdin
$ echo "saturday,sunday" | levenshtein-edit-distance
# 3
On a MacBook Air, it runs about 1,909,000 op/s.
Levenshtein — to be fair, it lets you inspect a matrix
113 op/s » op/s * 1,000
natural — to be fair, it offers more options
183 op/s » op/s * 1,000
levenshtein-deltas
237 op/s » op/s * 1,000
levenshtein-component
305 op/s » op/s * 1,000
fast-levenshtein
1,141 op/s » op/s * 1,000
Leven — fast.
2,076 op/s » op/s * 1,000
levenshtein-edit-distance — this module
1,909 op/s » op/s * 1,000
FAQs
Levenshtein edit distance
We found that levenshtein-edit-distance demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers 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
Ransomware costs victims an estimated $30 billion per year and has gotten so out of control that global support for banning payments is gaining momentum.
Application Security
New SEC disclosure rules aim to enforce timely cyber incident reporting, but fear of job loss and inadequate resources lead to significant underreporting.
Security News
The Python Software Foundation has secured a 5-year sponsorship from Fastly that supports PSF's activities and events, most notably the security and reliability of the Python Package Index (PyPI).