Skip to content

Instantly share code, notes, and snippets.

@vitiko
Last active February 20, 2019 20:54
Show Gist options
  • Save vitiko/bbe028e29cd12efdf03d4a40c3561447 to your computer and use it in GitHub Desktop.
Save vitiko/bbe028e29cd12efdf03d4a40c3561447 to your computer and use it in GitHub Desktop.
Chaincode key functions from ChaincodeStubInterface
interface ChaincodeStubInterface {
// The function creates a key by combining the attributes into a single string.
// The arguments must be valid utf8 strings and must not contain U+0000 (nil byte) and U+10FFFF charactres.
func CreateCompositeKey(objectType string, attributes []string) (string, error)
// The function splits the compositeKey into attributes from which the key was formed.
// This function is useful for extracting attributes from keys returned by range queries.
func SplitCompositeKey(compositeKey string) (string, []string, error)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment