Security News
Supply Chain Attack Detected in Solana's web3.js Library
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
github.com/AlexWan0/go-watrix
waveletTree is a Go package for myriad array operations using wavelet trees.
waveletTree stores a non-negative intger array V[0...n), 0 <= V[i] < s and support almost all operations in O(log s) time (not depends on num) using at most (n * log_2 s) bits plus small overheads for storing auxiually indices.
import "github.com/hillbig/waveletTree"
builder := NewBuilder()
for i := uint64(0); i < N; i++ {
builder.PushBack(uint64(rand.Int63())) // set values by PushBck
}
wt := builder.Build() // Build returns WaveletTree
// WaveletTree conceptually stores a non-negative integer array V[0...num)
// where 0 <= V[i] < s
// WaveletTree supports all operations in O(log s) time (not depend on num)
x := wt.Lookup(ind) // Lookup returns V[x]
rank := wt.Rank(ind, x) // Rank returns the number of xs in V[0...in)
sel := wt.Select(rank, x) // Select returns the position of (rank+1)-th x in V
v := wt.Quantile(Range{beg, end}, k) // Quantile returns k-th largest value in V[beg, end)
The results shows that RSDic operations require always (almost) constant time with regard to the length and one's ratio.
go test -bench=.
// Build a waveletTree for an integer array of length 10^6 with s = 2^64
BenchmarkWTBuild1M 1 1455321650 ns/op
// 1.455 micro sec per an interger
// A waveletTree for an integer array of length 10M (10^7) with s = 2^64
BenchmarkWTBuild10M 1 1467061166 ns/op
BenchmarkWTLookup10M 100000 29319 ns/op
BenchmarkWTRank10M 100000 28278 ns/op
BenchmarkWTSelect10M 50000 50250 ns/op
BenchmarkWTQuantile10M 100000 28852 ns/op
// An array []uint64 of length 10M (10^7) for comparison
BenchmarkRawLookup10M 20000000 109 ns/op
BenchmarkRawRank10M 500 4683822 ns/op
BenchmarkRawSelect10M 500 6085992 ns/op
BenchmarkRawQuantile10M 100 44362885 ns/op
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 supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
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.