base58

package
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 11, 2016 License: BSD-3-Clause Imports: 7 Imported by: 2

README

GoDoc GitHub license

base58

Overview

This is base58check library, from https://github.com/prettymuchbryce/hellobitcoin and https://github.com/tv42/base58.

That's it.

Requirements

This requires

  • git
  • go 1.3+

Installation

 $ go get github.com/utamaro/base58

Example

(This example omits error handlings for simplicity.)


import base58

func main(){
	test:=[]byte{0x01,0x02}
	result, err := Sum(test)

...
}

Contribution

Improvements to the codebase and pull requests are encouraged.

Documentation

Overview

Package base58 implements a human-friendly base58 encoding.

As opposed to base64 and friends, base58 is typically used to convert integers. You can use big.Int.SetBytes to convert arbitrary bytes to an integer first, and big.Int.Bytes the other way around.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decode

func Decode(value string) ([]byte, error)

Decode decodes base58 value to bytes.

func DecodeToBig

func DecodeToBig(src []byte) (*big.Int, error)

DecodeToBig a big integer from the bytes. Returns an error on corrupt input.

func Encode

func Encode(encoded []byte) string

Encode encodes byteData to base58.

func EncodeBig

func EncodeBig(dst []byte, src *big.Int) []byte

EncodeBig encodes src, appending to dst. Be sure to use the returned new value of dst.

Types

type CorruptInputError

type CorruptInputError int64

CorruptInputError representds input is corrupted.

func (CorruptInputError) Error

func (e CorruptInputError) Error() string

Error is to implement Error interface.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL