/// 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.
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.
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 .
pub fn hash_object(kind: ObjectType, bytes: &[u8]) -> Result<Oid, Error> {
        ::init();
        let mut out = raw::git_oid { id: [0; raw::GIT_OID_RAWSZ] };
        unsafe {
            try_call!(raw::git_odb_hash(&mut out,
                                        bytes.as_ptr()
                                            as *const libc::c_void,
                                        bytes.len(),
                                        kind.raw()));
        }
        Ok(Oid { raw: out })
    }
pub fn hash_object ( kind : ObjectType , bytes : & [ u8 ] ) -> Result < Oid , Error > { :: init ( ) ; let mut out = raw :: git_oid { id : [ 0 ; raw :: GIT_OID_RAWSZ ] } ; unsafe { try_call ! ( raw git_odb_hash ( mut out bytes as_ptr ( ) as const libc c_void bytes len ( ) kind raw ( ) ) ) ; } Ok ( Oid { raw : out } ) }
Hashes the provided data as an object of the provided type, and returns
an Oid corresponding to the result.
Hashes the provided data as an object of the provided type and returns an Oid corresponding to the result .
kind
ObjectType
bytes
&[u8]