libgit2

git_oid_fromstrn

Version:

Parse N characters of a hex formatted object id into a git_oid.

If N is odd, the last byte's high nibble will be read in and the low nibble set to zero.

Signature

int git_oid_fromstrn(git_oid *out, const char *str, size_t length);

Parameters

In
out

oid structure the result is written into.

const char *
In
str

input hex string of at least size length

size_t
In
length

length of the input string

Returns

int

0 or an error code

Versions