
Research
/Security News
9 Malicious NuGet Packages Deliver Time-Delayed Destructive Payloads
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.
github.com/madhavjivrajani/go-jump-consistent-hash
Advanced tools
This is a Golang implementation of a A Fast, Minimal Memory, Consistent Hash Algorithm called The Jump Consistent Algorithm. Ref: https://arxiv.org/pdf/1406.2294.pdf
go get github.com/MadhavJivrajani/go-jump-consistent-hash
package main
import (
"fmt"
jch "github.com/MadhavJivrajani/go-jump-consistent-hash"
)
func main() {
// a dummy stream of keys
stream := []unit64{132415, 134131, 223, 6, 1, 76, 446, 8888}
// number of buckets available
var numBuckets int32 = 7
for _, ele := range stream {
// calculate the bucket number of the key
// should be in range [0, 6)
err := process(jch.Hash(ele, numBuckets))
if err != nil {
panic(err)
}
}
}
// do some processing with the calculated bucket number
func process(bucket int64) error {
fmt.Println("Bucket:", bucket)
return nil
}
Please feel free to raise an issue if you find something that can be implemented in a better way or if something is just wrong.
uint64FAQs
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
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.

Security News
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.

Security News
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.