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
- Host: GitHub
- URL: https://github.com/deployable/base58-random
- Owner: deployable
- License: other
- Created: 2018-03-02T01:50:36.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2018-03-02T01:55:31.000Z (almost 8 years ago)
- Last Synced: 2025-02-09T20:28:23.483Z (about 1 year ago)
- Language: JavaScript
- Size: 22.5 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
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)