Jim Myhrberg 64e23a8d0c Simplify exposed method API
This package serves a single purpose, convert between integers and
base58 strings the same as a Flickr does. It has no need for supporting
custom alphabets passed in a runtime.
2016-06-29 01:27:37 +01:00
2016-06-29 00:13:52 +01:00
2016-06-29 01:27:37 +01:00
2016-06-29 01:27:37 +01:00
2016-06-29 00:13:52 +01:00
2016-06-29 00:19:30 +01:00

go-base58 Build Status

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
Base58 encoding and decoding for Go.
Readme 126 KiB
Languages
Go 100%