Skip to content

darkcodewrangler/base64-uuid

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Base64UUID

Generate url-safe short UUID like Youtube.

Installation

npm i base64-uuid --save

# or

yarn add base64-uuid

Usage

// commonjs
const { Base64UUID } = require("base64-uuid");

// or ES module
import { Base64UUID } from "base64-uuid";

/**
 * You can use the static `generate` method
 */
const uid = Base64UUID.generate(); // kVwcshidzw

// or instatiate it

const uid = new Base64UUID().generate(); // kVwcshidzw

Configuration

By default, the length of the generated uuid is 10, but if you prefer a longer one, you can specify the length.

const uid = Base64UUID.generate(25); // 7C00JcaaggLV9WTwA_08maUCd

const uid = new Base64UUID(25).generate(); // 7C00JcaaggLV9WTwA_08maUCd

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published