選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

sha1_gogit.go 522B

1234567891011121314151617181920
  1. // Copyright 2015 The Gogs Authors. All rights reserved.
  2. // Copyright 2019 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. //go:build gogit
  6. package git
  7. import (
  8. "github.com/go-git/go-git/v5/plumbing"
  9. )
  10. // SHA1 a git commit name
  11. type SHA1 = plumbing.Hash
  12. // ComputeBlobHash compute the hash for a given blob content
  13. func ComputeBlobHash(content []byte) SHA1 {
  14. return plumbing.ComputeHash(plumbing.BlobObject, content)
  15. }