{"@context":"https://w3id.org/codemeta/3.0","@type":"SoftwareSourceCode","identifier":"pkg:golang/github.com/google/orderedcode","name":"github.com/google/orderedcode","description":"Package orderedcode provides a byte encoding of a sequence of typed items.\nThe resulting bytes can be lexicographically compared to yield the same\nordering as item-wise comparison on the original sequences.\n\nMore precisely, suppose:\n\nThen comparing A versus B lexicographically is the same as comparing the\nvectors [A_1..A_n] and [B_1..B_n] lexicographically.\n\nFurthermore, if i \u003c j then [A_1..A_i]'s encoding is a prefix of [A_1..A_j]'s\nencoding.\n\nThe order-maintaining and prefix properties described above are useful for\ngenerating keys for databases like Bigtable.\n\nCall Append(buffer, item1, ..., itemN) to construct the encoded bytes. The\nvalid item types are:\n\nAs a convenience, orderedcode.Infinity is a value of type struct{}. For\nexample, to encode a sequence of two strings, an 'infinity' and an uint64:\n\nAlternatively, encoding can be done in multiple steps:\n\nCall Parse(encoded, \u0026item1, ..., \u0026itemN) to deconstruct an encoded string.\nThe valid argument types are the pointers to the valid encoding types. For\nexample:\n\nAlternatively:\n\nA TrailingString is a string that, if present, must be the last item appended\nor parsed. It is not mandatory to use a TrailingString; it is valid for the\nlast item to be a standard string or any other type listed above. A\nTrailingString simply allows a more efficient encoding while retaining the\nlexicographic order-maintaining property. If used, you cannot append a\nTrailingString and parse the result as a standard string, or as a\nStringOrInfinity. For example:\n\nThe same sequence of types should be used for encoding and decoding (although\nStringOrInfinity can substitute for either a string or a struct{}, but not for\na TrailingString). The wire format is not fully self-describing:\n\"\\x00\\x01\\x04\\x03\\x02\\x00\\x01\" is a valid encoding of both [\"\", \"\\x04\\x03\\x02\"]\nand [uint64(0), uint64(4), uint64(0x20001)]. Decoding into a pointer of the\nwrong type may return corrupt data and no error.\n\nEach item can optionally be encoded in decreasing order. If the i'th item is\nand the lexicographic comparison of A and B comes down to A_i versus B_i, then\nA \u003c B will equal A_i \u003e B_i.\n\nTo encode in decreasing order, wrap the item in an orderedcode.Decr value. To\ndecode, wrap the item pointer in an orderedcode.Decr. For example:\n\nEach item's ordering is independent from other items, but the same ordering\nshould be used to encode and decode the i'th item.","version":"v0.0.1","softwareVersion":"v0.0.1","license":"https://spdx.org/licenses/Apache-2.0","codeRepository":"https://github.com/google/orderedcode","issueTracker":"https://github.com/google/orderedcode/issues","url":"https://github.com/google/orderedcode","programmingLanguage":{"@type":"ComputerLanguage","name":"Go"},"dateCreated":"2019-02-13","dateModified":"2019-02-13","datePublished":"2019-02-13","copyrightYear":2019,"downloadUrl":"https://proxy.golang.org/github.com/google/orderedcode/@v/v0.0.1.zip","softwareHelp":{"@type":"WebSite","url":"https://pkg.go.dev/github.com/google/orderedcode#section-documentation"},"applicationCategory":"go","runtimePlatform":"go","developmentStatus":"active","sameAs":["https://pkg.go.dev/github.com/google/orderedcode"],"https://www.w3.org/ns/activitystreams#likes":41,"https://forgefed.org/ns#forks":12}