units

package
v1.0.54 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2025 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Bi  = uint64(1)
	KiB = 1024 * Bi
	MiB = 1024 * KiB
	GiB = 1024 * MiB
	TiB = 1024 * GiB
)
View Source
const (
	B  = uint64(1)
	KB = 1000 * B
	MB = 1000 * KB
	GB = 1000 * MB
	TB = 1000 * GB
)

Variables

This section is empty.

Functions

func ByteCount

func ByteCount[T constraints.Unsigned](b T, unit uint64, suffix string) string

func ByteCountIEC

func ByteCountIEC[T constraints.Unsigned](b T) string

func ByteCountSI

func ByteCountSI[T constraints.Unsigned](b T) string

Types

This section is empty.

Jump to

Keyboard shortcuts

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