multiformats/go-multibase

Type the base identifier

Closed this issue · 1 comments

Would be nice to type the identifier of the base:

type Base rune

const (
    Base1        = Base('1')
    Base2        = Base('0')
    Base8        = Base('7')
    Base10       = Base('9')
    Base16       = Base('f')
    Base58Flickr = Base('Z')
    Base58BTC    = Base('z')
)

this way we can make functions like:

// StringBase returns the Base s is in.
func StringBase(s string) Base { ... }

This was done in p.r. #9.

I think we can close this.