
Research
Two Malicious Rust Crates Impersonate Popular Logger to Steal Wallet Keys
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
Implements the Goertzel algorithm for efficient frequency detection.
var goertzel = require('goertzel')
var opts = {
// 1 kHz
targetFrequency: 1000,
// samples per second
sampleRate: 10000,
// samples per frame
samplesPerFrame: 100
}
var detect = goertzel(opts)
// generate sine wave at some Hz and time (ms)
function sin (hz, t) {
return Math.sin(Math.PI * 2 * t * hz)
}
// sine at 1 kHz for 100 samples
var data = []
for (var i = 0; i < opts.samplesPerFrame; i++) {
var v = sin(opts.targetFrequency, i / opts.sampleRate)
data.push(v)
}
console.log(detect(data))
true
Returns a function set to detect a single frequency.
opts
is mandatory, and has some required and optional parameters:
opts.targetFrequency
(required) - the frequency, in Hertz, to detect the
presence ofopts.sampleRate
(required) - how many samples are taken per second. For best
results, this should be at least twice the Nyquist
frequency. 2.5x works well.opts.samplesPerFrame
(required) - how many samples will be included in each
frame to be tested.opts.threshold
(optional) - The Goertzel algorithm returns a relative
magnitude of how well the samples match the targetFrequency
. Set this to
control the threshold. In general, the default value can be used safely.Returns a boolean
: true
if the targetFrequency
is present in the samples,
and false
otherwise.
data
is expected to be compatible with a Float32Array
.
With npm installed, run
$ npm install goertzel
MIT
FAQs
Fast frequency detection using the Goertzel algorithm
The npm package goertzel receives a total of 5 weekly downloads. As such, goertzel popularity was classified as not popular.
We found that goertzel demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers 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
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
Research
A malicious package uses a QR code as steganography in an innovative technique.
Research
/Security News
Socket identified 80 fake candidates targeting engineering roles, including suspected North Korean operators, exposing the new reality of hiring as a security function.