libgit2

git_odb_hash

Version:

Determine the object-ID (sha1 hash) of a data buffer

The resulting SHA-1 OID will the itentifier for the data buffer as if the data buffer it were to written to the ODB.

Signature

int git_odb_hash(git_oid *id, const void *data, size_t len, git_otype type);

Parameters

In
id

the resulting object-ID.

const void *
In
data

data to hash

size_t
In
len

size of the data

In
type

of the data to hash

Returns

int

0 or an error code

Versions