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 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. }