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.
array-math
Advanced tools
Do math on arrays: find divisors or factors of a number, or sum or multiply an array.
##Install npm install array-math
##Require var aMath = require('array-math')
##Methods ##aMath.factors(n)
n is a positive integer
aMath.factors(2)
// -> [2]
aMath.factors(96)
// -> [2, 2, 2, 2, 2, 3]
aMath.factors(100)
// -> [2, 2, 5, 5]
##aMath.divisors(n)
n is a positive integer
aMath.divisors(2)
// -> [2]
aMath.divisors(96)
// -> [1, 2, 3, 4, 6, 8, 12, 16, 24, 32, 48, 96]
aMath.divisors(100)
// -> [1, 2, 4, 5, 10, 20, 25, 50, 100]
##aMath.multiply(a)
a is an array of numbers (integers, floats, negative, whatever)
aMath.multiply([2, 96, 100])
// -> 19200
aMath.multiply([40, 3, 17])
// -> 2040
aMath.multiply([4, 5, 2, 5.2, 3.8])
// -> 790.4
aMath.multiply([520, 0.2, 0.2, 0.8])
// -> 16.64
##aMath.sum(a)
a is an array of numbers (integers, floats, negative, whatever)
aMath.sum([2, 96, 100])
// -> 198
aMath.sum([2, -96, 100])
// -> 6
aMath.sum([45, 20, 8.3])
// -> 73.3
FAQs
Do math on arrays: find divisors or factors of a number, sum or multiply an array, and much more!
The npm package array-math receives a total of 14 weekly downloads. As such, array-math popularity was classified as not popular.
We found that array-math demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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.
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.