Skip to content

goshort encodes an integer id into a url safe string

Notifications You must be signed in to change notification settings

nexthack/goshort

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

ShortURL

Inspired from https://github.com/delight-im/ShortURL .An encoding scheme to convert an id to a string and vice versa.Uses a space of 52 characters and is url safe.

The auto increment id from database can be encoded and used as url shortener

Usage

  • goshort.encode() takes an ID and turns it into a short string
  • goshort.decode() takes a short string and turns it into an ID

Example output

  • 3141592 <=> vJST
  • 123456789 <=> pgK8p

License

This project is licensed under the terms of the MIT License.

About

goshort encodes an integer id into a url safe string

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages