hash

package
v5.0.0-...-c65899a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 25, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

package hash provides a way for managing the underlying hash implementations used across go-git.

Index

Constants

View Source
const (
	// CryptoType defines what hash algorithm is being used.
	CryptoType = crypto.SHA1
	// Size defines the amount of bytes the hash yields.
	Size = 20
	// HexSize defines the strings size of the hash when represented in hexadecimal.
	HexSize = 40
)

Variables

This section is empty.

Functions

func RegisterHash

func RegisterHash(h crypto.Hash, f func() hash.Hash) error

RegisterHash allows for the hash algorithm used to be overridden. This ensures the hash selection for go-git must be explicit, when overriding the default value.

Types

type Hash

type Hash interface {
	hash.Hash
}

Hash is the same as hash.Hash. This allows consumers to not having to import this package alongside "hash".

func New

func New(h crypto.Hash) Hash

New returns a new Hash for the given hash function. It panics if the hash function is not registered.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL