hash

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

func ConvertChecksumsToMap

func ConvertChecksumsToMap(checksums []Checksum) map[string]string

Types

type Checksum

type Checksum drsapi.Checksum

type ChecksumType

type ChecksumType string

ChecksumType represents the digest method used to create the checksum

const (
	ChecksumTypeSHA1     ChecksumType = "sha1"
	ChecksumTypeSHA256   ChecksumType = "sha256"
	ChecksumTypeSHA512   ChecksumType = "sha512"
	ChecksumTypeMD5      ChecksumType = "md5"
	ChecksumTypeETag     ChecksumType = "etag"
	ChecksumTypeCRC32C   ChecksumType = "crc32c"
	ChecksumTypeTrunc512 ChecksumType = "trunc512"
)

IANA Named Information Hash Algorithm Registry values and other common types

type HashInfo

type HashInfo struct {
	MD5    string `json:"md5,omitempty"`
	SHA    string `json:"sha,omitempty"`
	SHA256 string `json:"sha256,omitempty"`
	SHA512 string `json:"sha512,omitempty"`
	CRC    string `json:"crc,omitempty"`
	ETag   string `json:"etag,omitempty"`
}

func ConvertChecksumsToHashInfo

func ConvertChecksumsToHashInfo(checksums []Checksum) HashInfo

func ConvertStringMapToHashInfo

func ConvertStringMapToHashInfo(inputHashes map[string]string) HashInfo

func (*HashInfo) UnmarshalJSON

func (h *HashInfo) UnmarshalJSON(data []byte) error

UnmarshalJSON accepts both the DRS map-based schema (Indexd) and the array-of-checksums schema (GA4GH).

Jump to

Keyboard shortcuts

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