Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
github.com/D-Bald/yourbasic-graph
Topological ordering, image by David Eppstein, CC0 1.0.
This library offers efficient and well-tested algorithms for
The algorithms can be applied to any graph data structure implementing
the two Iterator
methods: Order
, which returns the number of vertices,
and Visit
, which iterates over the neighbors of a vertex.
All algorithms operate on directed graphs with a fixed number of vertices, labeled from 0 to n-1, and edges with integer cost. An undirected edge {v, w} of cost c is represented by the two directed edges (v, w) and (w, v), both of cost c. A self-loop, an edge connecting a vertex to itself, is both directed and undirected.
The type Mutable
represents a directed graph with a fixed number
of vertices and weighted edges that can be added or removed.
The implementation uses hash maps to associate each vertex
in the graph with its adjacent vertices. This gives constant
time performance for all basic operations.
The type Immutable
is a compact representation of an immutable graph.
The implementation uses lists to associate each vertex in the graph
with its adjacent vertices. This makes for fast and predictable
iteration: the Visit method produces its elements by reading
from a fixed sorted precomputed list.
The subpackage graph/build
offers a tool for building graphs of type Virtual
.
In a virtual graph no vertices or edges are stored in memory, they are instead computed as needed. New virtual graphs are constructed by composing and filtering a set of standard graphs, or by writing functions that describe the edges of a graph.
The following standard graphs are predefined:
The following operations are supported:
Non-virtual graphs can be imported, and used as building blocks,
by the Specific
function. Virtual graphs don't need to be “exported”;
they implement the Iterator
interface and hence can be used directly
by any algorithm in the graph package.
Once you have installed Go, run this command
to install the graph
package:
go get github.com/yourbasic/graph
There is an online reference for the package at godoc.org/github.com/yourbasic/graph.
The only accepted reason to modify the API of this package is to handle issues that can't be resolved in any other reasonable way.
New features and performance enhancements are limited to basic algorithms and data structures, akin to the ones that you might find in a computer science textbook.
Stefan Nilsson – korthaj
FAQs
Unknown package
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 malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.