Skip to main content

Simple base62 encode and decode for integers.

This package works with Cloudflare Workers, Node.js, DenoIt is unknown whether this package works with Bun, Browsers
This package works with Cloudflare Workers
This package works with Node.js
This package works with Deno
It is unknown whether this package works with Bun
It is unknown whether this package works with Browsers
JSR Score
100%
Published
2 weeks ago (0.0.2)
function encode
encode(n: number): string

Encode a given positive integer in base62 format.

Parameters

  • The integer

Return Type

  • The encoded integer

Throws

If provided value is not a supported numeric value (must be a positive integer less than Number.MAX_SAFE_INTEGER).

Add Package

deno add jsr:@funnylookinhat/base62

Import symbol

import { encode } from "@funnylookinhat/base62";

---- OR ----

Import directly with a jsr specifier

import { encode } from "jsr:@funnylookinhat/base62";

Add Package

npx jsr add @funnylookinhat/base62

Import symbol

import { encode } from "@funnylookinhat/base62";

Add Package

yarn dlx jsr add @funnylookinhat/base62

Import symbol

import { encode } from "@funnylookinhat/base62";

Add Package

pnpm dlx jsr add @funnylookinhat/base62

Import symbol

import { encode } from "@funnylookinhat/base62";

Add Package

bunx jsr add @funnylookinhat/base62

Import symbol

import { encode } from "@funnylookinhat/base62";