Skip to content

hashObjectOid

Hashes the provided data as an object of the provided type, and returns an Oid corresponding to the result. This does not store the object inside any object database or repository.

Signature

ts
function hashObjectOid(objType: ObjectType, bytes: Buffer): string;

Parameters

  • objTyperequired · ObjectType

    Git object type.

    - Any : Any kind of git object
    - Commit : An object which corresponds to a git commit
    - Tree : An object which corresponds to a git tree
    - Blob : An object which corresponds to a git blob
    - Tag : An object which corresponds to a git tag

  • bytesrequired · Buffer

    Data to hashed.

Returns

  • string

    Hashed string.

Released under the MIT License.