mirror of
https://github.com/jimeh/go-base58.git
synced 2026-02-19 08:06:39 +00:00
6ce87d138a5fcc0e16ce81e46225d5f6a3439102
go-base58 
A Base58 encoding and decoding package for Go.
What?
Base58 allows you to represent a numeric value with fewer characters, useful for short URLs among other things. Flickr is one the biggest sites that makes use of it for short photo URLs.
For example 6857269519 becomes brXijP when Base58 encoded, and hence the
Flickr short URL is: http://flic.kr/p/brXijP
Installation
go get https://github.com/jimeh/go-base58
Usage
import "github.com/jimeh/go-base58"
uid := base58.Encode(6857269519)
fmt.Println(uid) // Prints: brXijP
num, err := base58.Decode('brXijP');
fmt.Println(num) // Prints: 6857269519
Credit
This package is more or less a port of the Base58 Ruby Gem by the same name. Which as far as I can tell, is based on this article by Flickr staff.
License
Released under the MIT license. Copyright (c) 2016 Jim Myhrberg.
Description
Languages
Go
100%