Function caprock_create_object_id
Defined in File basics.h
Function Documentation
-
caprock_error_t caprock_create_object_id(void *buffer, size_t *bufsize, char const *name, size_t name_size, caprock_identifier_hash_length hash_length)
Create a claim’s object identifier from an object name.
- Parameters
buffer – [out] The output buffer.
bufsize – [inout] The output buffer’s maximum size before calling. After successful identifier creation, this contains the amount of data used.
name – [in] The object name to create an identifier from.
name_size – [in] The size of the object name. If 0 is given, the name must be NUL-terminated, and the size will be determined automatically.
hash_length – [in] The hash length to use. Note that unlike when creating identifiers from keys, CIH_ANY is not valid here, but explicit lengths from caprock_identifier_hash_length are.
- Return values
CAPROCK_ERR_SUCCESS – On success;
bufsize
will contain the amount of data used.CAPROCK_ERR_INVALID_VALUE – If any input parameters were missing or invalid.
CAPROCK_ERR_CODEC – If the identifier could not be encoded for some reason.