id

package
v0.0.0-...-fd3fa5d Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2017 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ID

type ID [32]byte

ID is the type representing a generated ID.

func New

func New(data []byte) ID

New generates a new ID from the given input bytes.

func NewFromBytes

func NewFromBytes(b []byte) ID

NewFromBytes creates a new ID with the value of the given byte slice. The given byte slice must be 32 bytes long (the same length as ID), or this function will panic.

func NewFromString

func NewFromString(s string) ID

NewFromString creates a new ID from the given string.

func (ID) Compare

func (i ID) Compare(other ID) int

Compares the two given IDs. Note that this function is NOT SAFE AGAINST TIMING ATTACKS. If you are simply checking for equality, please use the Equals function, which is.

func (ID) Equals

func (i ID) Equals(other ID) bool

Checks the two given IDs for equality. This function uses a constant-time comparison algorithm to prevent timing attacks.

func (*ID) MarshalText

func (i *ID) MarshalText() ([]byte, error)

Implements the `TextMarshaler` interface from the encoding package.

func (ID) String

func (i ID) String() string

String returns the canonical representation of the ID.

func (*ID) UnmarshalText

func (i *ID) UnmarshalText(bs []byte) (err error)

Implements the `TextUnmarshaler` interface from the encoding package.

type ImproperCertsNumberError

type ImproperCertsNumberError struct {
	// contains filtered or unexported fields
}

ImproperCertsNumberError is returned from Server/Client whenever the remote peer presents a number of PeerCertificates that is not 1.

func (ImproperCertsNumberError) Error

func (e ImproperCertsNumberError) Error() string

Jump to

Keyboard shortcuts

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