code.gitea.io/gitea@v1.19.3/modules/git/sha1_gogit.go (about) 1 // Copyright 2015 The Gogs Authors. All rights reserved. 2 // Copyright 2019 The Gitea Authors. All rights reserved. 3 // SPDX-License-Identifier: MIT 4 5 //go:build gogit 6 7 package git 8 9 import ( 10 "github.com/go-git/go-git/v5/plumbing" 11 ) 12 13 // SHA1 a git commit name 14 type SHA1 = plumbing.Hash 15 16 // ComputeBlobHash compute the hash for a given blob content 17 func ComputeBlobHash(content []byte) SHA1 { 18 return plumbing.ComputeHash(plumbing.BlobObject, content) 19 }