Documentation ¶
Index ¶
- Constants
- Variables
- func DoubleSha256Bytes(b []byte) []byte
- func EncodeVarLenInt(n uint64) []byte
- func GetAdjustedTimeSec() int64
- func GetHashBytesFromStr(src string) (bytes []byte, err error)
- func GetRand(nMax uint64) uint64
- func GetRandInt(nMax int) int
- func GetTimeMicroSec() int64
- func GetTimeOffsetSec() int64
- func GetTimeSec() int64
- func GetUint64FromReder(r io.Reader) (uint64, error)
- func Hash160(buf []byte) []byte
- func InsecureRand32() uint32
- func InsecureRand64() uint64
- func MaxI(a, b int64) int64
- func MaxI32(a, b int32) int32
- func MaxU(a, b uint64) uint64
- func MaxU32(a, b uint32) uint32
- func MinI(a, b int64) int64
- func MinI32(a, b int32) int32
- func MinU(a, b uint64) uint64
- func MinU32(a, b uint32) uint32
- func RandomUint64() (uint64, error)
- func ReadElements(r io.Reader, elements ...interface{}) error
- func ReadVarBytes(r io.Reader, maxAllowed uint64, fieldName string) ([]byte, error)
- func ReadVarInt(r io.Reader) (uint64, error)
- func ReadVarLenInt(r io.Reader) (uint64, error)
- func ReadVarString(r io.Reader) (string, error)
- func Ripemd160(buf []byte) []byte
- func SetMockTime(time int64)
- func Sha1(buf []byte) [20]byte
- func Sha256Bytes(b []byte) []byte
- func SipHash(k0, k1 uint64, hash []byte) uint64
- func SipHashExtra(k0, k1 uint64, hash []byte, extra uint32) uint64
- func Swap(s *Stack, other *Stack)
- func VarIntSerializeSize(val uint64) uint32
- func VarLenIntSize(n uint64) uint
- func WriteElements(w io.Writer, elements ...interface{}) error
- func WriteVarBytes(w io.Writer, bytes []byte) error
- func WriteVarInt(w io.Writer, val uint64) error
- func WriteVarLenInt(w io.Writer, n uint64) error
- func WriteVarString(w io.Writer, str string) error
- type BinaryFreeList
- func (b BinaryFreeList) Borrow() (buf []byte)
- func (b BinaryFreeList) PutUint16(w io.Writer, byteOrder binary.ByteOrder, val uint16) error
- func (b BinaryFreeList) PutUint32(w io.Writer, byteOrder binary.ByteOrder, val uint32) error
- func (b BinaryFreeList) PutUint64(w io.Writer, byteOrder binary.ByteOrder, val uint64) error
- func (b BinaryFreeList) PutUint8(w io.Writer, val uint8) error
- func (b BinaryFreeList) Return(buf []byte)
- func (b BinaryFreeList) Uint16(r io.Reader, byteOrder binary.ByteOrder) (uint16, error)
- func (b BinaryFreeList) Uint32(r io.Reader, byteOrder binary.ByteOrder) (uint32, error)
- func (b BinaryFreeList) Uint64(r io.Reader, byteOrder binary.ByteOrder) (uint64, error)
- func (b BinaryFreeList) Uint8(r io.Reader) (uint8, error)
- type FastRandomContext
- type FeeRate
- type Hash
- func (hash *Hash) Cmp(other *Hash) int
- func (hash *Hash) Decode(r io.Reader) (int, error)
- func (hash *Hash) Encode(w io.Writer) (int, error)
- func (hash *Hash) EncodeSize() uint32
- func (hash *Hash) GetCloneBytes() []byte
- func (hash *Hash) IsEqual(target *Hash) bool
- func (hash *Hash) IsNull() bool
- func (hash *Hash) Serialize(w io.Writer) (int, error)
- func (hash *Hash) SerializeSize() uint32
- func (hash Hash) String() string
- func (hash *Hash) ToBigInt() *big.Int
- func (hash *Hash) Unserialize(r io.Reader) (int, error)
- type MedianTime
- type SipHasher
- type Stack
- func (s *Stack) Copy() *Stack
- func (s *Stack) CountBool(val bool) int
- func (s *Stack) Empty() bool
- func (s *Stack) Equal(other *Stack) bool
- func (s *Stack) Erase(begin int, end int) bool
- func (s *Stack) Insert(index int, value interface{}) bool
- func (s *Stack) Pop() interface{}
- func (s *Stack) Push(value interface{})
- func (s *Stack) RemoveAt(index int) bool
- func (s *Stack) SetTop(i int, value interface{}) bool
- func (s *Stack) Size() int
- func (s *Stack) Swap(i int, j int) bool
- func (s *Stack) Top(i int) interface{}
Constants ¶
View Source
const ( IoMaxSize = 1024 MaxSize = 0x02000000 )
View Source
const ( // SatoshiPerBitcent is the number of satoshi in one bitcoin cent. SatoshiPerBitcent = 1e6 // SatoshiPerBitcoin is the number of satoshi in one bitcoin (1 BTC). SatoshiPerBitcoin = 1e8 // MaxSatoshi is the maximum transaction amount allowed in satoshi. MaxSatoshi = 21e6 * SatoshiPerBitcoin /*OneMegaByte 1MB */ OneMegaByte uint64 = 1000000 )
View Source
const ( COIN int64 = 100000000 MaxMoney = 21000000 * COIN // MinFeeRate minimum and Maximum values for tracking feeRates MinFeeRate int64 = 10 MaxFee int64 = 1e7 InfFeeRate int64 = MaxMoney InfPriority float64 = 1e9 * float64(MaxMoney) DefaultMinRelayTxFeePerK int64 = 1000 //FeeSpacing we have to lump transactions into buckets based on feeRate, but we want to be // able to give accurate estimates over a large range of potential feeRates. // Therefore it makes sense to exponentially space the buckets FeeSpacing float64 = 1.1 CurrencyUnit = "BCH" )
View Source
const ( // MaxBlockConfirms track confirm delays up to 25 blocks, can't estimate beyond that MaxBlockConfirms uint = 25 // DefaultDecay decay of .998 is a half-life of 346 blocks or about 2.4 days DefaultDecay float64 = .998 // MinSuccessPct require greater than 95% of X feeRate transactions to be confirmed within Y // blocks for X to be big enough MinSuccessPct float64 = .95 // SufficientFeeTxs Require an avg of 1 tx in the combined feeRate bucket per block to have stat // significance SufficientFeeTxs float64 = 1 )
View Source
const ( Hash256Size = 32 MaxHashStringSize = Hash256Size * 2 Hash160Size = 20 )
Variables ¶
View Source
var HashOne = Hash{0x0000000000000000000000000000000000000000000000000000000000000001}
View Source
var HashZero = Hash{0x0000000000000000000000000000000000000000000000000000000000000000}
Functions ¶
func DoubleSha256Bytes ¶
func EncodeVarLenInt ¶
func GetAdjustedTimeSec ¶ added in v0.0.5
func GetAdjustedTimeSec() int64
func GetHashBytesFromStr ¶
func GetRandInt ¶
func GetTimeMicroSec ¶ added in v0.0.5
func GetTimeMicroSec() int64
func GetTimeOffsetSec ¶ added in v0.0.5
func GetTimeOffsetSec() int64
func GetTimeSec ¶ added in v0.0.5
func GetTimeSec() int64
func InsecureRand32 ¶
func InsecureRand32() uint32
InsecureRand32 create a random number in [0 math.MaxUint32]
func InsecureRand64 ¶
func InsecureRand64() uint64
func RandomUint64 ¶
func ReadElements ¶
func ReadVarBytes ¶
func SetMockTime ¶
func SetMockTime(time int64)
func Sha256Bytes ¶
func VarIntSerializeSize ¶
func VarLenIntSize ¶
func WriteElements ¶
Types ¶
type BinaryFreeList ¶
type BinaryFreeList chan []byte
var BinarySerializer BinaryFreeList = make(chan []byte, IoMaxSize)
func (BinaryFreeList) Borrow ¶
func (b BinaryFreeList) Borrow() (buf []byte)
func (BinaryFreeList) Return ¶
func (b BinaryFreeList) Return(buf []byte)
type FastRandomContext ¶
type FastRandomContext struct {
// contains filtered or unexported fields
}
func NewFastRandomContext ¶
func NewFastRandomContext(fDeterministic bool) *FastRandomContext
func (*FastRandomContext) Rand32 ¶
func (f *FastRandomContext) Rand32() uint32
type FeeRate ¶
type FeeRate struct {
SataoshisPerK int64
}
FeeRate : Fee rate in satoshis per kilobyte: Amount / kB
func NewFeeRate ¶
func NewFeeRateWithSize ¶
func (*FeeRate) GetFeePerK ¶
GetFeePerK : Return the fee in satoshis for a size of 1000 bytes
func (*FeeRate) SerializeSize ¶
type Hash ¶
type Hash [Hash256Size]byte
func DoubleSha256Hash ¶
func GetHashFromStr ¶
func GetRandHash ¶
func GetRandHash() *Hash
func HashFromString ¶
func Sha256Hash ¶
func (*Hash) EncodeSize ¶
func (*Hash) GetCloneBytes ¶
func (*Hash) SerializeSize ¶
type MedianTime ¶ added in v0.0.4
type MedianTime struct {
// contains filtered or unexported fields
}
func GetMedianTimeSource ¶ added in v0.0.6
func GetMedianTimeSource() *MedianTime
func (*MedianTime) AddTimeSample ¶ added in v0.0.4
func (medianTime *MedianTime) AddTimeSample(sourceID string, timeVal time.Time)
type SipHasher ¶
type SipHasher struct {
// contains filtered or unexported fields
}
func NewSipHasher ¶
func (*SipHasher) WriteUint64 ¶
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
algorithm
|
|
Package base58 provides an API for working with modified base58 and Base58Check encodings.
|
Package base58 provides an API for working with modified base58 and Base58Check encodings. |
Click to show internal directories.
Click to hide internal directories.