checksum

package
v1.2.7 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2025 License: AGPL-3.0, AGPL-3.0-or-later Imports: 12 Imported by: 0

Documentation

Overview

SPDX-License-Identifier: AGPL-3.0-or-later

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ComputeOptions

type ComputeOptions struct {
	MaxBytes           int64
	TimeoutMs          int
	MaxRedirects       int
	AllowedContentType []string
	SkipSSRFCheck      bool // For testing only - disables SSRF protection
	InsecureSkipVerify bool // For testing only - disables TLS verification
}

ComputeOptions configures the remote checksum computation behavior

func DefaultOptions

func DefaultOptions() ComputeOptions

DefaultOptions returns the default configuration for checksum computation

type Result

type Result struct {
	ChecksumHex string
	Algorithm   string
}

ChecksumResult represents the result of a checksum computation

func ComputeRemoteChecksum

func ComputeRemoteChecksum(ctx context.Context, urlStr string, opts ComputeOptions) (*Result, error)

ComputeRemoteChecksum downloads a remote binary file and computes its SHA-256 checksum Returns nil if the file cannot be processed (too large, wrong type, network error, SSRF blocked) The context is used for request cancellation and timeout propagation.

Jump to

Keyboard shortcuts

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