Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
weighted-damerau-levenshtein
Advanced tools
An implementation of weighted Damerau–Levenshtein distance.
A simple Node module that allows you to compute Damerau–Levenshtein
distance
with custom weights for insertion, deletion and/or substitution (they all
default to 1
). It is inspired by the
damerau-levenshtein
and
damerau-levenshtein-js
packages.
let dldist = require('weighted-damerau-levenshtein');
const d = dldist('hello word', 'Hello World!');
// 4 -> two substitutions and two insertions
const s = dldist('hello word', 'Hello World!', { insWeight: 0.5 });
// 3 -> two substitutions with weight 1 and two insertions with weight 0.5
It also optionally allows you to turn-off the "Damerau" part of the Damerau-Levenshtein distance (i..e the transpositions), which makes it the standard Levenshtein distance.
let dldist = require('weighted-damerau-levenshtein');
const d = dldist('Hi there', 'Hi tehre');
// 1 -> one transpostion (counted with the default subsitution weight)
const s = dldist('Hi there', 'Hi tehre', { useDamerau: false });
// 2 -> one substitution and one deletion (both with default weight)
npm install weighted-damerau-levenshtein
Licensed under the terms of the Apache 2.0 license. See the LICENSE file for more details.
FAQs
An implementation of weighted Damerau–Levenshtein distance.
The npm package weighted-damerau-levenshtein receives a total of 137 weekly downloads. As such, weighted-damerau-levenshtein popularity was classified as not popular.
We found that weighted-damerau-levenshtein 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.