Documentation ¶
Index ¶
- Constants
- func AllDifferentStrings(lst []string) bool
- func Bytes(obj interface{ ... }) ([]byte, error)
- func ExistsFilePath(filePath string) (bool, error)
- func GentleTruncate(s string, length int) string
- func GetHashValue(obj interface{ ... }) hashing.HashValue
- func Int32To4Bytes(val int32) []byte
- func Int64From8Bytes(b []byte) (int64, error)
- func Int64To8Bytes(val int64) []byte
- func IsSubset(sub, super []string) bool
- func LocateFile(fileName string, relativePath ...string) string
- func MakeRange(from, to int) []int
- func MustBytes(obj interface{ ... }) []byte
- func MustUint16From2Bytes(b []byte) uint16
- func MustUint32From4Bytes(b []byte) uint32
- func MustUint64From8Bytes(b []byte) uint64
- func MustUint8From1Bytes(b []byte) uint8
- func ReadBoolByte(r io.Reader, cond *bool) error
- func ReadByte(r io.Reader) (byte, error)
- func ReadBytes16(r io.Reader) ([]byte, error)
- func ReadBytes32(r io.Reader) ([]byte, error)
- func ReadHashValue(r io.Reader, h *hashing.HashValue) error
- func ReadInt32(r io.Reader, pval *int32) error
- func ReadInt64(r io.Reader, pval *int64) error
- func ReadMarshaled(r io.Reader, val encoding.BinaryUnmarshaler) error
- func ReadOutputID(r io.Reader, oid *ledgerstate.OutputID) error
- func ReadString16(r io.Reader) (string, error)
- func ReadStrings16(r io.Reader) ([]string, error)
- func ReadTime(r io.Reader, ts *time.Time) error
- func ReadUint16(r io.Reader, pval *uint16) error
- func ReadUint32(r io.Reader, pval *uint32) error
- func ReadUint64(r io.Reader, pval *uint64) error
- func ReadUint8(r io.Reader, pval *uint8) error
- func SelectDeterministicRandomUint16(selectFrom []uint16, seed int64) uint16
- func StringInList(s string, lst []string) bool
- func Uint16From2Bytes(b []byte) (uint16, error)
- func Uint16To2Bytes(val uint16) []byte
- func Uint32From4Bytes(b []byte) (uint32, error)
- func Uint32To4Bytes(val uint32) []byte
- func Uint64From8Bytes(b []byte) (uint64, error)
- func Uint64To8Bytes(val uint64) []byte
- func Uint8From1Bytes(b []byte) (uint8, error)
- func Uint8To1Bytes(val uint8) []byte
- func ValidPermutation(perm []uint16) bool
- func WriteBoolByte(w io.Writer, cond bool) error
- func WriteByte(w io.Writer, val byte) error
- func WriteBytes16(w io.Writer, data []byte) error
- func WriteBytes32(w io.Writer, data []byte) error
- func WriteInt64(w io.Writer, val int64) error
- func WriteMarshaled(w io.Writer, val encoding.BinaryMarshaler) error
- func WriteString16(w io.Writer, str string) error
- func WriteStrings16(w io.Writer, strs []string) error
- func WriteTime(w io.Writer, ts time.Time) error
- func WriteUint16(w io.Writer, val uint16) error
- func WriteUint32(w io.Writer, val uint32) error
- func WriteUint64(w io.Writer, val uint64) error
- func WriteUint8(w io.Writer, val uint8) error
- type Permutation16
- type WaitChan
Constants ¶
View Source
const MaxUint16 = int(^uint16(0))
View Source
const MaxUint32 = int(^uint32(0))
Variables ¶
This section is empty.
Functions ¶
func AllDifferentStrings ¶ added in v0.2.0
func ExistsFilePath ¶ added in v0.1.0
Exists returns whether the given file or directory exists.
func GentleTruncate ¶ added in v0.1.0
func GetHashValue ¶
func Int32To4Bytes ¶ added in v0.2.0
func Int64From8Bytes ¶ added in v0.1.0
func Int64To8Bytes ¶ added in v0.2.0
func LocateFile ¶ added in v0.1.0
func MakeRange ¶ added in v0.2.0
MakeRange returns slice with a range of elements starting from to up to from-1, inclusive
func MustUint16From2Bytes ¶ added in v0.1.0
func MustUint32From4Bytes ¶ added in v0.1.0
func MustUint64From8Bytes ¶ added in v0.1.0
func MustUint8From1Bytes ¶ added in v0.2.3
func ReadMarshaled ¶ added in v0.1.0
func ReadMarshaled(r io.Reader, val encoding.BinaryUnmarshaler) error
ReadMarshaled supports kyber.Point, kyber.Scalar and similar.
func ReadOutputID ¶ added in v0.2.0
func ReadOutputID(r io.Reader, oid *ledgerstate.OutputID) error
func SelectDeterministicRandomUint16 ¶ added in v0.2.0
func StringInList ¶ added in v0.2.0
func Uint16From2Bytes ¶
func Uint16To2Bytes ¶
func Uint32From4Bytes ¶
func Uint32To4Bytes ¶
func Uint64From8Bytes ¶
func Uint64To8Bytes ¶
func Uint8From1Bytes ¶ added in v0.2.3
func Uint8To1Bytes ¶ added in v0.2.3
func ValidPermutation ¶
func WriteMarshaled ¶ added in v0.1.0
func WriteMarshaled(w io.Writer, val encoding.BinaryMarshaler) error
WriteMarshaled supports kyber.Point, kyber.Scalar and similar.
Types ¶
type Permutation16 ¶
type Permutation16 struct {
// contains filtered or unexported fields
}
Permutation16 deterministic permutation of integers from 0 to size-1
func NewPermutation16 ¶
func NewPermutation16(size uint16, seed []byte) *Permutation16
func (*Permutation16) Current ¶
func (perm *Permutation16) Current() uint16
func (*Permutation16) GetArray ¶
func (perm *Permutation16) GetArray() []uint16
func (*Permutation16) Next ¶
func (perm *Permutation16) Next() uint16
func (*Permutation16) Shuffle ¶
func (perm *Permutation16) Shuffle(seed []byte) *Permutation16
type WaitChan ¶ added in v0.1.0
type WaitChan struct {
// contains filtered or unexported fields
}
WaitChan is something similar to sync.WaitGroup, just is based on channels and supports waiting with timeout.
func NewWaitChan ¶ added in v0.1.0
func NewWaitChan() *WaitChan
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
package implement a simple primitive to wait for readiness of concurrent modules
|
package implement a simple primitive to wait for readiness of concurrent modules |
package implements simple semaphore with timeout
|
package implements simple semaphore with timeout |
Click to show internal directories.
Click to hide internal directories.