github.com/gitbundle/modules@v0.0.0-20231025071548-85b91c5c3b01/git/sha1_gogit.go (about)

     1  // Copyright 2023 The GitBundle Inc. All rights reserved.
     2  // Copyright 2017 The Gitea Authors. All rights reserved.
     3  // Use of this source code is governed by a MIT-style
     4  // license that can be found in the LICENSE file.
     5  
     6  // Copyright 2015 The Gogs Authors. All rights reserved.
     7  
     8  //go:build gogit
     9  
    10  package git
    11  
    12  import (
    13  	"github.com/go-git/go-git/v5/plumbing"
    14  )
    15  
    16  // SHA1 a git commit name
    17  type SHA1 = plumbing.Hash
    18  
    19  // ComputeBlobHash compute the hash for a given blob content
    20  func ComputeBlobHash(content []byte) SHA1 {
    21  	return plumbing.ComputeHash(plumbing.BlobObject, content)
    22  }