Options
All
  • Public
  • Public/Protected
  • All
Menu

Class UUIDBaseX

Base-XX UUID Encoder / Decoder

Hierarchy

  • UUIDBaseX

Index

Constructors

Properties

Methods

Constructors

constructor

  • new UUIDBaseX(alphabet: string | BaseConverter): UUIDBaseX

Properties

base

base: BaseConverter

I don't need to hide this from you but like just use base-x directly?

Methods

fromUUID

  • fromUUID(input: string): string
  • Takes an UUID and returns an encoded UUID as with the alphabet you've provided

    Throws if it's not a valid encoded uuid

    Parameters

    • input: string

      a regular ole UUID

    Returns string

toUUID

  • toUUID(input: string): string
  • Takes an encoded UUID and returns a UUID as regular people know them

    Throws if it's not a valid encoded uuid

    Parameters

    • input: string

      an encodedUUID

    Returns string

v4

  • v4(options?: V4Options): string
  • Create a version 4 (random) UUID in your alphabet

    Parameters

    Returns string

Static base62

  • Makes a UUIDBaseX setup with the base62 alphabet a-z, A-Z, and 0-9

    Returns UUIDBaseX

Static base64

  • Makes a UUIDBaseX setup with the base64 alphabet a-z, A-Z, 0-9, _, and -. The UUIDs made with these will be a little shorter but uglier than base62.

    Returns UUIDBaseX

Static urlSafe

Generated using TypeDoc