All projects

Integer Compressor

An efficient URL-friendly integer compression system for mapping integers to compact strings.

Integer Compressor provides efficient bidirectional mapping between integers and compact URL-friendly strings, perfect for short URLs and resource identifiers.

Features

  • Bijective mapping: One-to-one between integers and strings
  • URL safe: Uses only URL-friendly characters
  • Variable length: Shorter codes for smaller integers
  • Bidirectional: Easy compression and decompression

Usage

import { compress, decompress } from 'integer-compressor';

// Compress an integer to a short string
const code = compress(12345); // "abcD"

// Decompress back to original integer
const num = decompress("abcD"); // 12345

Status

Work in progress - Core compression algorithm and URL pair mapping being developed.