{"modulePath":"github.com/eric-erki/https-hyperledger.org","version":"v1.4.4","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package util\n\n## Functions\n\n```go\nfunc ComputeHash(input []byte) []byte\n```\nComputeHash computes the hash of the given bytes\n\n```go\nfunc ComputeStringHash(input string) []byte\n```\nComputeStringHash computes the hash of the given string\n\n```go\nfunc DecodeReverseOrderVarUint64(bytes []byte) (uint64, int)\n```\nDecodeReverseOrderVarUint64 decodes the number from the bytes obtained from function 'EncodeReverseOrderVarUint64'. Also, returns the number of bytes that are consumed in the process\n\n```go\nfunc EncodeReverseOrderVarUint64(number uint64) []byte\n```\nEncodeReverseOrderVarUint64 returns a byte-representation for a uint64 number such that the number is first subtracted from MaxUint64 and then all the leading 0xff bytes are trimmed and replaced by the number of such trimmed bytes. This helps in reducing the size. In the byte order comparison this encoding ensures that EncodeReverseOrderVarUint64(A) \u003e EncodeReverseOrderVarUint64(B), If B \u003e A\n\n```go\nfunc GetSortedKeys(m interface{}) []string\n```\nGetSortedKeys returns the keys of the map in a sorted order. This function assumes that the keys are string\n\n```go\nfunc GetValuesBySortedKeys(mapPtr interface{}, listPtr interface{})\n```\nGetValuesBySortedKeys returns the values of the map (mapPtr) in the list (listPtr) in the sorted order of key of the map This function assumes that the mapPtr is a pointer to a map and listPtr is is a pointer to a list. Further type of keys of the map are assumed to be string and the types of the values of the maps and the list are same\n\n## Types\n\n```go\ntype TxValidationFlags []uint8\n```\nTxValidationFlags is array of transaction validation codes. It is used when committer validates block.\n\n```go\nfunc NewTxValidationFlags(size int) TxValidationFlags\n```\nNewTxValidationFlags Create new object-array of validation codes with target size. Default values: TxValidationCode\\_NOT\\_VALIDATED\n\n```go\nfunc NewTxValidationFlagsSetValue(size int, value peer.TxValidationCode) TxValidationFlags\n```\nNewTxValidationFlagsSetValue Creates new object-array of validation codes with target size and the supplied value\n\n```go\nfunc (obj TxValidationFlags) Flag(txIndex int) peer.TxValidationCode\n```\nFlag returns validation code at specified transaction\n\n```go\nfunc (obj TxValidationFlags) IsInvalid(txIndex int) bool\n```\nIsInvalid checks if specified transaction is invalid\n\n```go\nfunc (obj TxValidationFlags) IsSetTo(txIndex int, flag peer.TxValidationCode) bool\n```\nIsSetTo returns true if the specified transaction equals flag; false otherwise.\n\n```go\nfunc (obj TxValidationFlags) IsValid(txIndex int) bool\n```\nIsValid checks if specified transaction is valid\n\n```go\nfunc (obj TxValidationFlags) SetFlag(txIndex int, flag peer.TxValidationCode)\n```\nSetFlag assigns validation code to specified transaction\n\n","path":"github.com/eric-erki/https-hyperledger.org/core/ledger/util","name":"util","synopsis":"","isRedistributable":true}
