Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

deployable/base62-random

Repository files navigation

base62-random

Generate random base62 strings quickly with better statistical dispersion than Math.random() unless Math.random is all that's available.

Largely based on uuid-random

Install

yarn add base62-random
npm install base62-random

Example Usage

Node

var base62 = require('base62-random');
base62(12); // 'KsykHbcCzUSL'

Browser

<script src="https://cdn.rawgit.com/deployable/base62-random/v0.3.5/base62-random.min.js"></script>
<script>
 base62(13); // 'BAhl1V1BfUmo3'
</script>

Is base62 string?

base62.test('5HXx8Eznu0'); // true
base62.test('P-f6cA4e'); // false

License

MIT

Links

About

Generate random base62 strings in Javascript

Topics

Resources

License

Stars

Watchers

Forks

Packages

Contributors

AltStyle によって変換されたページ (->オリジナル) /