Skip to main content

A utility to shorten UUIDs using base62 encoding.

Project description

Python Library: uuid_shortener

A simple utility to shorten UUIDs using base62 encoding.

Installation

Install using pip:

pip install uuid_shortener

Usage

from uuid_shortener import UUIDShortener

original_uuid = 'your-uuid-here'
shortened = UUIDShortener.encode(original_uuid)
print(f'Shortened UUID: {shortened}')

restored = UUIDShortener.decode(shortened)
print(f'Restored UUID: {restored}')

Replace your-uuid-here with an actual UUID to test.

Example

a = str(uuid.uuid4())
print(a)
# >> 5798a735-d00f-4c1d-b86b-15603c6fda82

b = UUIDShortener.encode(a)
print(b)
# >> 2Fi5TIkiHjpn5ZkCA9WOky

print(UUIDShortener.decode(b))
# >> 5798a735-d00f-4c1d-b86b-15603c6fda82

License

This project is licensed under the MIT License - see the LICENSE.txt file for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

uuid_shortener-0.1.3.tar.gz (3.1 kB view details)

Uploaded Source

File details

Details for the file uuid_shortener-0.1.3.tar.gz.

File metadata

  • Download URL: uuid_shortener-0.1.3.tar.gz
  • Upload date:
  • Size: 3.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.7

File hashes

Hashes for uuid_shortener-0.1.3.tar.gz
Algorithm Hash digest
SHA256 df88586314b4fc29415d6fed7016ae0122a6211e9c5a01d661859edc8043a59f
MD5 066706201853ab1de7215848376a1f92
BLAKE2b-256 2f2af0706966a2d2f126a20ddf80860c2d88184dda36ee3719310de34805b79c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page