libgit2

git_odb_hash

Deprecated
Version:

Generate the SHA1 object ID for a given data buffer.

Deprecations

  • use `git_object_id_from_buffer`

Signature

int git_odb_hash(git_oid *oid, const void *data, size_t len, git_object_t object_type);

Parameters

Out
oid

the resulting object ID.

const void *
In
data

data to hash

size_t
In
len

size of the data

In
object_type

of the data to hash

Returns

int

0 or an error code

Versions