Documentation
¶
Index ¶
- func CRandBytes(numBytes int) []byte
- func CRandHex(numDigits int) string
- func CReader() io.Reader
- func MixEntropy(seedBytes []byte)
- func Sha256(bytes []byte) []byte
- type Address
- type HexBytes
- func (bz HexBytes) Bytes() []byte
- func (bz HexBytes) Format(s fmt.State, verb rune)
- func (bz HexBytes) Marshal() ([]byte, error)
- func (bz HexBytes) MarshalJSON() ([]byte, error)
- func (bz HexBytes) String() string
- func (bz *HexBytes) Unmarshal(data []byte) error
- func (bz *HexBytes) UnmarshalJSON(data []byte) error
- type PrivKey
- type PubKey
- type Symmetric
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CRandHex ¶
CRandHex returns a hex encoded string that's floor(numDigits/2) * 2 long.
Note: CRandHex(24) gives 96 bits of randomness that are usually strong enough for most purposes.
func MixEntropy ¶
func MixEntropy(seedBytes []byte)
Mix additional bytes of randomness, e.g. from hardware, user-input, etc. It is OK to call it multiple times. It does not diminish security.
Types ¶
type Address ¶
type Address = HexBytes
An address is a []byte, but hex-encoded even in JSON. []byte leaves us the option to change the address length. Use an alias so Unmarshal methods (with ptr receivers) are available too.
type HexBytes ¶
type HexBytes []byte
The main purpose of HexBytes is to enable HEX-encoding for json/encoding.
func (HexBytes) MarshalJSON ¶
This is the point of Bytes.
func (*HexBytes) UnmarshalJSON ¶
This is the point of Bytes.
Click to show internal directories.
Click to hide internal directories.