util

package
v2.1.0-alpha.7 Latest Latest
Warning

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

Go to latest
Published: May 22, 2023 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultPieceSize 4M
	DefaultPieceSize = 4 * 1024 * 1024

	// DefaultPieceSizeLimit 15M
	DefaultPieceSizeLimit = 15 * 1024 * 1024
)

Variables

This section is empty.

Functions

func ComputePieceCount added in v2.0.5

func ComputePieceCount(length int64, pieceSize uint32) int32

ComputePieceCount returns piece count with given length and pieceSize

func ComputePieceSize

func ComputePieceSize(length int64) uint32

ComputePieceSize computes the piece size with specified fileLength.

If the fileLength<0, which means failed to get fileLength and then use the DefaultPieceSize.

Types

This section is empty.

Jump to

Keyboard shortcuts

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