bytemath

package module
v0.0.0-...-6a01d2b Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2024 License: GPL-3.0 Imports: 2 Imported by: 5

README

bytemath & bitcalc

A library for converting filesize information.

build bitcalc

% go build -o bitcalc main/*

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertBytes

func ConvertBytes(iIn int64, s Suffix) float64

func ConvertBytesToHumanReadable

func ConvertBytesToHumanReadable(sizeInBytes int64) string

func ConvertToBytes

func ConvertToBytes(bytes float64, suffix Suffix) float64

func GetValueTable

func GetValueTable(bytes int64) map[Suffix]float64

Types

type Suffix

type Suffix int
const (
	B Suffix = iota
	KB
	MB
	GB
	TB
	PB
)

func GetSuffixByString

func GetSuffixByString(s string) *Suffix

type SuffixStrings

type SuffixStrings struct {
	Short string
	Long  string
}

func GetSuffixString

func GetSuffixString(sfx Suffix) SuffixStrings

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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