Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
react-native-get-random-values
Advanced tools
Readme
crypto.getRandomValues
for React NativeA small implementation of crypto.getRandomValues
for React Native. This is useful to polyfill for libraries like uuid that depend on it.
npm install react-native-get-random-values
npx pod-install
💡 If you use the Expo managed workflow you will see "CocoaPods is not supported in this project" - this is fine, it's not necessary.
This library works as a polyfill for the global crypto.getRandomValues
.
// Add this line to your `index.js`
import 'react-native-get-random-values'
Now you can use uuid
or other libraries that assume crypto.getRandomValues
is available.
import { v4 as uuid } from 'uuid'
console.log(uuid())
crypto.getRandomValues(typedArray)
The crypto.getRandomValues()
method lets you get cryptographically strong random values. The array given as the parameter is filled with random numbers (random in its cryptographic meaning).
To guarantee enough performance, implementations are not using a truly random number generator, but they are using a pseudo-random number generator seeded with a value with enough entropy. The PRNG used differs from one implementation to the other but is suitable for cryptographic usages. Implementations are also required to use a seed with enough entropy, like a system-level entropy source.
typedArray
- Is an integer-based TypedArray, that is an Int8Array
, a Uint8Array
, an Int16Array
, a Uint16Array
, an Int32Array
, or a Uint32Array
. All elements in the array are going to be overridden with random numbers.Returns the typed array that was passed in.
FAQs
A small implementation of `crypto.getRandomValues` for React Native. This is useful to polyfill for libraries like [uuid](https://www.npmjs.com/package/uuid) that depend on it.
The npm package react-native-get-random-values receives a total of 701,053 weekly downloads. As such, react-native-get-random-values popularity was classified as popular.
We found that react-native-get-random-values demonstrated a healthy version release cadence and project activity because the last version was released less than 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
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.