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

https://github.com/deployable/base58-random

Create random base58 strings
https://github.com/deployable/base58-random

Last synced: 3 months ago
JSON representation

Create random base58 strings

Awesome Lists containing this project

README

          

# base58-random

Generate random [base58 strings]() quickly with better
[statistical dispersion](https://en.wikipedia.org/wiki/Statistical_dispersion)
than `Math.random()` unless Math.random is all that's available.

Largely based on [`uuid-random`](https://github.com/jchook/uuid-random)

## Install

yarn add base58-random
npm install base58-random

## Example Usage

### Node

```javascript
var base58 = require('base58-random');
base58(12); // 'KsykHbcCzUSL'
```

### Browser

```html

base58(13); // 'BAho2V4BfUmo3'

```

### Is base58 string?

```javascript
base58.test('4rhdLsp32qn'); // true
base58.test('5HXx8Eznu0'); // false
base58.test('P-f6cA4e'); // false
```

## License

MIT

## Links

- Also see [deployable/base62-random](https://github.com/deployable/base62-random)
- Based on [jchook/uuid-random](https://github.com/jchook/uuid-random)
- github [deployable/base58-random](https://github.com/deployable/base58-random)
- npm [base62-random](https://www.npmjs.com/package/base58-random)