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 450B

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