You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

sha1_gogit.go 538B

123456789101112131415161718192021
  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. // +build gogit
  7. package git
  8. import (
  9. "github.com/go-git/go-git/v5/plumbing"
  10. )
  11. // SHA1 a git commit name
  12. type SHA1 = plumbing.Hash
  13. // ComputeBlobHash compute the hash for a given blob content
  14. func ComputeBlobHash(content []byte) SHA1 {
  15. return plumbing.ComputeHash(plumbing.BlobObject, content)
  16. }