package
0.0.0-20250204070817-3c82b7ad6a9f
Repository: https://github.com/0chain/gosdk_common.git
Documentation: pkg.go.dev
# Functions
DecodeAndMHash will decode hex-encoded string to []byte format.
GetNewUUID will give new version1 uuid.
GetRandom returns n random slice from in If n > len(in), then this will return a shuffled version of in.
GetSHA1Uuid will give version 5 uuid.
Hash - the hashing used for the merkle tree construction */.
HashStringToBytes - convert a hex hash string to bytes */.
MaxInt returns the maximum of two integers - x: first integer - y: second integer.
MaxInt64 returns the maximum of two int64 - x: first int64 - y: second int64.
MHash - merkle hashing of a pair of child hashes */.
No description provided by the author
MinInt returns the minimum of two integers - x: first integer - y: second integer.
MinInt64 returns the minimum of two int64 - x: first int64 - y: second int64.
NewFixedMerkleTree create a FixedMerkleTree with specify hash method.
No description provided by the author
NewHTTPGetRequest create a GetRequest instance with 60s timeout.
NewHTTPGetRequestContext create a GetRequest with context and url.
No description provided by the author
NewRand create a ProgressiveRand instance.
No description provided by the author
NewValidationTree creates a new validation tree - dataSize is the size of the data.
No description provided by the author
Shuffle returns a shuffled version of a string slice - in: input slice.
ToHex - converts a byte array to hex encoding with upper case */.
No description provided by the author
# Constants
No description provided by the author
FixedMerkleLeaves is the number of leaves in the fixed merkle tree.
FixedMTDepth is the depth of the fixed merkle tree.
Left tree node chile.
MaxMerkleLeavesSize is the maximum size of the data that can be written to the merkle tree.
MerkleChunkSize is the size of a chunk of data that is hashed.
Right tree node child.
No description provided by the author
# Variables
No description provided by the author
No description provided by the author
ErrNoItem there is no item anymore.
# Structs
FixedMerklePath is used to verify existence of leaf hash for fixed merkle tree.
FixedMerkleTree A trusted mekerle tree for outsourcing attack protection.
No description provided by the author
No description provided by the author
No description provided by the author
MerklePathForMultiLeafVerification is used to verify multiple blocks with single instance of merkle path.
MerkleTree - A data structure that implements MerkleTreeI interface */.
MTPath - The merkle tree path*/.
No description provided by the author
No description provided by the author
Rand a progressive rand.
SecureSerializableValue - a proxy persisted value that just tracks the encoded bytes of a persisted value */.
No description provided by the author
ValidationTree is a merkle tree that is used to validate the data.
# Interfaces
Hashable anything that can provide it's hash.
No description provided by the author
MerkleTreeI - a merkle tree interface required for constructing and providing verification */.
SecureSerializableValueI an interface that makes a serializable value secure with hashing */.
Serializable interface */.