git_odb_hash

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

The resulting OID will be the identifier for the data buffer as if the data buffer it were to written to the ODB.

  1. int git_odb_hash(libgit2.oid.git_oid* out_, const(void)* data, size_t len, libgit2.types.git_object_t object_type, libgit2.oid.git_oid_t oid_type)
    version(GIT_EXPERIMENTAL_SHA256)
    extern (C) nothrow @nogc public
    int
    git_odb_hash
  2. int git_odb_hash(libgit2.oid.git_oid* out_, const(void)* data, size_t len, libgit2.types.git_object_t type)

Parameters

out_ libgit2.oid.git_oid*

the resulting object-ID.

data const(void)*

data to hash

len size_t

size of the data

object_type libgit2.types.git_object_t

of the data to hash

oid_type libgit2.oid.git_oid_t

the oid type to hash to

Return Value

Type: int

0 or an error code

Meta