ethav

package module
v0.0.0-...-a09e203 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2019 License: MIT Imports: 4 Imported by: 0

README

ethav (ethereum-address-validator)

Simple address validator for ETH

Checks format and checksum of address

Installation

  1. Download and install:
go get -u github.com/KOREAN139/ethereum-address-validator
  1. Import it in your code:
import "github.com/KOREAN139/ethereum-address-validator"

Quick Start

package main

import "github.com/KOREAN139/ethereum-address-validator"

func main() {
    // ethav.Validate(ETH address) will return error if address is invalid
    if err := ethav.Validate("0xdbF03B407c01E7cD3CBea99509d93f8DDDC8C6FB"); err != nil {
        // do error handling
    }
    // do your work
}

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrorTypeFormat is set when address has invalid format
	ErrorTypeFormat = errors.New("Invalid format of ethereum address")
	// ErrorTypeChecksum is set when address has wrong checksum
	ErrorTypeChecksum = errors.New("Invalid checksum")
)

Functions

func Validate

func Validate(addr string) error

Validate validates given address

Types

This section is empty.

Jump to

Keyboard shortcuts

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