{"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## Constants\n\n```go\nconst DELIMITER = \".\"\n```\n\n## Functions\n\n```go\nfunc ArrayToChaincodeArgs(args []string) [][]byte\n```\nArrayToChaincodeArgs converts array of string args to array of \\[]byte args\n\n```go\nfunc ComputeSHA256(data []byte) (hash []byte)\n```\nComputeSHA256 returns SHA2-256 on data\n\n```go\nfunc ComputeSHA3256(data []byte) (hash []byte)\n```\nComputeSHA3256 returns SHA3-256 on data\n\n```go\nfunc ConcatenateBytes(data ...[]byte) []byte\n```\nConcatenateBytes is useful for combining multiple arrays of bytes, especially for signatures or digests over multiple fields\n\n```go\nfunc CreateUtcTimestamp() *timestamp.Timestamp\n```\nCreateUtcTimestamp returns a google/protobuf/Timestamp in UTC\n\n```go\nfunc ExtractRemoteAddress(ctx context.Context) string\n```\n\n```go\nfunc FindMissingElements(all []string, some []string) (delta []string)\n```\nFindMissingElements identifies the elements of the first slice that are not present in the second The second slice is expected to be a subset of the first slice\n\n```go\nfunc Flatten(i interface{}) []string\n```\n\\`flatten\\` recursively retrieves every leaf node in a struct in depth-first fashion and aggregate the results into given string slice with format: \"path.to.leaf = value\" in the order of definition. Root name is ignored in the path. This helper function is useful to pretty-print a struct, such as configs. for example, given data structure:\n\n\tA{\n\t  B{\n\t    C: \"foo\",\n\t    D: 42,\n\t  },\n\t  E: nil,\n\t}\n\nit should yield a slice of string containing following items: \\[\n\n\t\"B.C = \\\"foo\\\"\",\n\t\"B.D = 42\",\n\t\"E =\",\n\n]\n\n```go\nfunc GenerateBytesUUID() []byte\n```\nGenerateBytesUUID returns a UUID based on RFC 4122 returning the generated bytes\n\n```go\nfunc GenerateHashFromSignature(path string, args []byte) []byte\n```\nGenerateHashFromSignature returns a hash of the combined parameters\n\n```go\nfunc GenerateIDWithAlg(customIDgenAlg string, payload []byte) (string, error)\n```\nGenerateIDWithAlg generates an ID using a custom algorithm\n\n```go\nfunc GenerateIDfromTxSHAHash(payload []byte) string\n```\nGenerateIDfromTxSHAHash generates SHA256 hash using Tx payload\n\n```go\nfunc GenerateIntUUID() *big.Int\n```\nGenerateIntUUID returns a UUID based on RFC 4122 returning a big.Int\n\n```go\nfunc GenerateUUID() string\n```\nGenerateUUID returns a UUID based on RFC 4122\n\n```go\nfunc GetSysCCVersion() string\n```\nGetSysCCVersion returns the version of all system chaincodes This needs to be revisited on policies around system chaincode \"upgrades\" from user and relationship with \"fabric\" upgrade. For now keep it simple and use the fabric's version stamp\n\n```go\nfunc GetTestChainID() string\n```\nGetTestChainID returns the CHAINID constant in use by orderer\n\n```go\nfunc GetTestOrgID() string\n```\nGetTestOrgID returns the ORGID constant in use by gossip join message\n\n```go\nfunc ToChaincodeArgs(args ...string) [][]byte\n```\nToChaincodeArgs converts string args to \\[]byte args\n\n","path":"github.com/eric-erki/https-hyperledger.org/common/util","name":"util","synopsis":"","isRedistributable":true}
