An open API service indexing awesome lists of open source software.

https://github.com/zilliqa/sodium-randbytes

sodium-randbytes
https://github.com/zilliqa/sodium-randbytes

Last synced: about 1 year ago
JSON representation

sodium-randbytes

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).