Security News
38% of CISOs Fear They’re Not Moving Fast Enough on AI
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
get-random-values
Advanced tools
window.crypto.getRandomValues
or window.msCrypto.getRandomValues
or
require('crypto').randomBytes
or an Error.
var getRandomValues = require('get-random-values');
var array = new Uint32Array(10);
getRandomValues(array);
// => [
// => 183,
// => 76,
// => 18,
// => 177,
// => 73,
// => 9,
// => 50,
// => 248,
// => 216,
// => 104
// => ]
$ npm install get-random-values
var getRandomValues = require('get-random-values');
getRandomValues(buf)
Fills integer-based TypedArray buf
with cryptographically random numbers.
Checks for and uses the first of the following:
window.crypto.getRandomValues
window.msCrypto.getRandomValues
If none of the above are available, then an Error is thrown.
Throws QuotaExceededError if buf.length > 65536
(even if Node.js crypto,
which doesn't have that limit, is being used).
buf
must be a Uint8Array if Node.js crypto is used, otherwise a
TypeError will be thrown.
FAQs
`window.crypto.getRandomValues` with fallback to Node.js crypto
We found that get-random-values 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
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.
Security News
Company News
Socket is joining TC54 to help develop standards for software supply chain security, contributing to the evolution of SBOMs, CycloneDX, and Package URL specifications.