# randomhex

> Will generate a random HEX string of a specifc byte size.

Latest version **0.1.5** (published 2017-03-24) · MIT license · 0 weekly downloads

## Install

```sh
npm install randomhex
pnpm add randomhex
yarn add randomhex
bun add randomhex
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.5 |
| Published | 2017-03-24 |
| First published | 2017-03-23 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 8 |
| Maintainers | frozeman |

## Links

- npm: https://www.npmjs.com/package/randomhex
- Repository: https://github.com/frozeman/randomHex
- Homepage: https://github.com/frozeman/randomHex#readme
- Issues: https://github.com/frozeman/randomHex/issues
- npm.io page: https://npm.io/package/randomhex

## Recent versions

- 0.1.5 (latest) — 2017-03-24
- 0.1.4 — 2017-03-24
- 0.1.3 — 2017-03-24
- 0.1.2 — 2017-03-24
- 0.1.1 — 2017-03-23
- 0.1.0 — 2017-03-23

## README

randomHex
===

Will create a random bytes HEX string, in node.js and browsers with crypto.

This library uses the [crypto.randomBytes()](https://nodejs.org/api/crypto.html#crypto_crypto_randombytes_size_callback) in node.js,
and [crypto.getRandomValues()](https://developer.mozilla.org/en/docs/Web/API/RandomSource/getRandomValues) in the browser.

Both of those random generators should provide cryptographically strong pseudo-random data. 

```
$ npm install randomhex
```



```js
var randomHex = require('randomhex');

randomHex(16); // get 16 random bytes as HEX string (0x + 32 chars)
> "0xd59e72dbf8612798aa1674834c80894e"

randomHex(32, console.log); // get 32 random bytes as HEX string (0x + 64 chars)
> null "0x409de75fc727d81a7d9f59580130ce3e76124679eb5c4647eb18c40512450c29"

```

---
_Source: https://npm.io/package/randomhex · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
