https://github.com/zilliqa/sodium-randbytes
sodium-randbytes
https://github.com/zilliqa/sodium-randbytes
Last synced: about 1 year ago
JSON representation
sodium-randbytes
- Host: GitHub
- URL: https://github.com/zilliqa/sodium-randbytes
- Owner: Zilliqa
- License: gpl-3.0
- Created: 2022-01-30T02:12:11.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2022-02-21T10:10:47.000Z (over 4 years ago)
- Last Synced: 2025-02-16T10:43:01.238Z (over 1 year ago)
- Language: TypeScript
- Homepage: https://www.npmjs.com/package/sodium-randbytes/access
- Size: 34.2 KB
- Stars: 0
- Watchers: 5
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
sodium-randbytes
It uses `randombytes_buf` of [`sodium-native`](https://github.com/sodium-friends/sodium-native) in Node and [`Crypto.getRandomValues`](https://developer.mozilla.org/en-US/docs/Web/API/Crypto/getRandomValues) in the browser.
## Installation
```sh
npm i sodium-randbytes
# or
yarn add sodium-randbytes
```
## Usage
```ts
import randomBytes from "sodium-randbytes";
// get 20 random bytes
const result = randomBytes(20);
```
## License
This project is open source software licensed as [GPL-3.0](./LICENSE).