pub fn new(hash_algo: HashAlgorithm, content: &[u8]) -> Self {
        let v = GitOid::generate_git_oid_from_buffer(
            hash_algo.create_digest(),
            BufReader::new(content),
            content.len(),
        )
        .unwrap(); // `unwrap` is usually code smell. In this case, we know there will be no I/O errors and the length will be correct
        GitOid {
            hash_algorithm: hash_algo,
            value: v.1,
            len: v.0,
        }
    }
/// create a new GitOid based on an in-memory array
create a new GitOid based on an in-memory array
create a new GitOid based on an in - memory array
pub fn new(hash_algo: HashAlgorithm, content: &[u8]) -> Self {
        let v = GitOid::generate_git_oid_from_buffer(
            hash_algo.create_digest(),
            BufReader::new(content),
            content.len(),
        )
        .unwrap(); // `unwrap` is usually code smell. In this case, we know there will be no I/O errors and the length will be correct
        GitOid {
            hash_algorithm: hash_algo,
            value: v.1,
            len: v.0,
        }
    }
pub fn new ( hash_algo : HashAlgorithm , content : & [ u8 ] ) -> Self { let v = GitOid :: generate_git_oid_from_buffer ( hash_algo . create_digest ( ) , BufReader :: new ( content ) , content . len ( ) , ) . unwrap ( ) ; // `unwrap` is usually code smell. In this case, we know there will be no I/O errors and the length will be correct GitOid { hash_algorithm : hash_algo , value : v . 1 , len : v . 0 , } }
create a new GitOid based on an in-memory array
create a new GitOid based on an in - memory array
hash_algo
HashAlgorithm
content
&[u8]
hash_algo
HashAlgorithm
content
&[u8]