-
Notifications
You must be signed in to change notification settings - Fork 202
Open
Description
Hi,
There is a function in cborparser.c: cbor_value_text_string_equals which checks if a char array is equal to the cbor value string. It would be helpful to also have this for a byte string, ie:
CborError cbor_value_byte_string_equals(const CborValue *value, const char *string, size_t len, bool *result)
{
CborValue copy = *value;
CborError err = cbor_value_skip_tag(©);
if (err)
return err;
if (!cbor_value_is_byte_string(©)) {
*result = false;
return CborNoError;
}
return iterate_string_chunks(©, CONST_CAST(char *, string), &len, result, NULL, iterate_memcmp);
}
This can't easily be implemented outside of the cborparser.c file because iterate_string_chunks is a static method contained to just this file.
I am happy to create a PR with this if that would help (I'm also happy to have someone else add it too), but I just wanted to check if this would be accepted?
Thanks.
Metadata
Metadata
Assignees
Labels
No labels