package
0.0.0-20200921075319-ce7d804eeb2f
Repository: https://github.com/xunleiblockchain/tc-libs.git
Documentation: pkg.go.dev
# Functions
AbsolutePath returns datadir + filename, or filename if it is absolute.
NOTE: Assumes that s is ASCII as per IsASCIIText(), otherwise panics.
BigToAddress returns Address with byte values of b.
BigToHash sets byte representation of b to hash.
No description provided by the author
No description provided by the author
Bytes2Hex returns the hexadecimal encoding of d.
Bytes2Uint returns the uint64 by the hexadecimal src.
BytesToAddress returns Address with value b.
BytesToHash sets b to hash.
No description provided by the author
CopyBytes returns an exact copy of the provided bytes.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Fingerprint returns the first 6 bytes of a byte slice.
FromHex returns the bytes represented by the hexadecimal string s.
GoPath returns GOPATH env variable value.
No description provided by the author
HasHexPrefix validates str begins with '0x' or '0X'.
Hex2Bytes returns the bytes represented by the hexadecimal string str.
Hex2BytesFixed returns bytes of a specified fixed length flen.
HexToAddress returns Address with byte values of s.
HexToHash sets byte representation of s to hash.
IsHex returns true for non-empty hex-string prefixed with "0x".
Returns true if s is a non-empty printable non-tab ascii character.
No description provided by the author
Returns true if it has zero length.
IsHex validates whether each byte is valid hexadecimal string.
IsHexAddress verifies whether a string can represent a valid hex-encoded Ethereum address or not.
IsLKC check whether a coin is LKC or other token.
Go lacks a simple and safe way to see if something is a typed nil.
No description provided by the author
Kill the running process by sending itself SIGTERM.
LeftPadBytes zero-pads slice to the left up to length l.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
NewBaseService creates a new BaseService.
There is no BitArray whose Size is 0.
New Error with formatted message.
New Error with specified data.
NewMixedcaseAddress constructor (mainly for testing).
NewMixedcaseAddressFromString is mainly meant for unit-testing.
No description provided by the author
Indicates a failure of consensus.
A panic here means something has gone horribly wrong, in the form of data corruption or failure of the operating system.
For those times when we're not sure if we should panic XXX DEPRECATED.
A panic resulting from a sanity check means there is a programmer error and some guarantee is not satisfied.
PrefixEndBytes returns the end byteslice for a noninclusive range that would include all byte slices for which the input is the prefix.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
RightPadBytes zero-pads slice to the right up to length l.
No description provided by the author
SplitAndTrim slices s into all subslices separated by sep and returns a slice of the string s with all leading and trailing Unicode code points contained in cutset removed.
StringInSlice returns true if a is found the list.
StripHex returns hex string without leading "0x".
No description provided by the author
No description provided by the author
ToHex returns the hex representation of b, prefixed with '0x'.
TrapSignal catches the SIGTERM and executes cb function.
No description provided by the author
No description provided by the author
No description provided by the author
WriteFileAtomic creates a temporary file with data and the perm given and swaps it atomically with filename if successful.
No description provided by the author
# Constants
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
# Variables
Common big integers often used.
Common big integers often used.
Common big integers often used.
Common big integers often used.
Common big integers often used.
Common big integers often used.
Common big integers often used.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Like fmt.Sprintf, but skips formatting if args are empty.
# Structs
Classical-inheritance-style service declarations.
No description provided by the author
FmtError is the data type for NewError() (e.g.
Define these here for compatibility but use tmlibs/common.KI64Pair.
Define these here for compatibility but use tmlibs/common.KVPair.
MixedcaseAddress retains the original string, which may or may not be correctly checksummed.
Rand is a prng, that is seeded with OS randomness.
# Type aliases
Address represents the 20 byte address of an Ethereum account.
Hash represents the 32 byte Keccak256 hash of arbitrary data.
The main purpose of HexBytes is to enable HEX-encoding for json/encoding.
No description provided by the author
No description provided by the author
StorageSize is a wrapper around a float value that supports user friendly formatting.
UnprefixedAddress allows marshaling an Address without 0x prefix.
UnprefixedHash allows marshaling a Hash without 0x prefix.