
Security News
curl Shuts Down Bug Bounty Program After Flood of AI Slop Reports
A surge of AI-generated vulnerability reports has pushed open source maintainers to rethink bug bounties and tighten security disclosure processes.
Provides a simple implementation of a consistent hash ring. By default it uses the 32-bit cyclic redundancy check (CRC-32) for calculating checksums, but can take any function that takes a byte slice and returns an unsigned 32bit integer. The current implementation, is not as efficient as it could be and can also be prone to hotspots though it should consistently distribute across the nodes +/- 3 percent (dependent on the number of replicates).
go get stvz.io/hashring
import "stvz.io/hashring"
// Initialize the ring with 3 replicas, using the default checksum function and
// add some nodes to the ring.
ring := hashring.New(3, nil)
ring.Add("server1", "server2", "server3", "server4", "server5")
To get the node from the ring, use the Get(key string) function. If there are no nodes available, the method returns an empty string.
if node := ring.Get("id"); node != "" {
sendFn(node, data)
}
For pull style distributed applications, the function Mine(name, key string) exists to determine whether or not the key that is being pulled belongs to the worker. It returns a boolean value. Assuming that the nodes use the hostname of the worker the following is an example:
hostname, _ := os.Hostname()
if ring.Mine(hostname, "id") {
processFn(data)
}
To remove a node (or nodes) use the Remove(node string) function.
ring.Remove("server1", "server2")
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.

Security News
A surge of AI-generated vulnerability reports has pushed open source maintainers to rethink bug bounties and tighten security disclosure processes.

Product
Scan results now load faster and remain consistent over time, with stable URLs and on-demand rescans for fresh security data.

Product
Socket's new Alert Details page is designed to surface more context, with a clearer layout, reachability dependency chains, and structured review.