libgit2

git_object_id_from_buffer

Version:

Given the raw content of an object, determine the object ID. This prepends the object header to the given data, and hashes the results with the hash corresponding to the given oid_type.

Signature

int git_object_id_from_buffer(git_oid *oid_out, const void *buf, size_t len, const git_object_id_options *opts);

Parameters

Out
oid_out

the resulting object id

const void *
In
buf

the raw object content

size_t
In
len

the length of the given buffer

In
opts

the options for id calculation

Returns

int

0 on success, or an error code

Versions