Research
Security News
Threat Actor Exposes Playbook for Exploiting npm to Build Blockchain-Powered Botnets
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
rle-components
Advanced tools
Connected component labeling / extraction for narrowband level sets
Connected component labelling for narrowband level sets. It is part of the rle-* collection of libraries for processing narrow band level sets.
First, install the package using npm:
npm install rle-components
Then you can use the library to split a level set into its connected components. For example:
//First create a volume
var volume = require("rle-sample").solid.dense([-32, -32, -32], [32, 32, 32], function(x) {
var s = Math.sin(x[0]) + Math.sin(x[1]) + Math.sin(x[2]);
var b = Math.max(Math.abs(x[0]), Math.abs(x[1]), Math.abs(x[2]));
return Math.max(s + 2.2, b - 9.9);
});
//Then split into separate components
var components = require("rle-components").split(volume);
Here is the result:
You can try out a demo in your browser.
require("rle-components").label(volume[, link_func, solid_func])
This takes a narrowband level set as input and assigns labels to the components.
volume
is the level set we are labellinglink_func(a,b)
determines if two phases should be considered linked in the same component. By default, always returns true.solid_func(a)
determines if a phase should be included in the components. By default, returns false for phase 0.The result of calling the function is a labelStruct
object which has the following properties:
count
The number of connected componentslabels
An array of integers of length = volume.length()
which gives the name of the connected component, starting at 0. Not solid components are labeled -1.require("rle-components").split(volume[, labelStruct])
This splits a volume into a collection of volumes with different connected components.
volume
is the volume to splitlabelStruct
(Optional) is the result of calling label()
(see above) on the volume. If not specified, label
is called with the default arguments.Returns an array of of volumes representing the different connected components of volume
(c) 2013 Mikola Lysenko. BSD
FAQs
Connected component labeling / extraction for narrowband level sets
We found that rle-components 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
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
Security News
NVD’s backlog surpasses 20,000 CVEs as analysis slows and NIST announces new system updates to address ongoing delays.
Security News
Research
A malicious npm package disguised as a WhatsApp client is exploiting authentication flows with a remote kill switch to exfiltrate data and destroy files.