github.com/go-playground/pkg/v5@v5.29.1/bytes/size.go (about)

     1  package bytesext
     2  
     3  // Bytes is a type alias to int64 in order to better express the desired data type.
     4  type Bytes = int64
     5  
     6  // Common byte unit sizes
     7  const (
     8  	BYTE = 1
     9  
    10  	// Decimal (Powers of 10 for Humans)
    11  	KB = 1000 * BYTE
    12  	MB = 1000 * KB
    13  	GB = 1000 * MB
    14  	TB = 1000 * GB
    15  	PB = 1000 * TB
    16  	EB = 1000 * PB
    17  	ZB = 1000 * EB
    18  	YB = 1000 * ZB
    19  
    20  	// Binary (Powers of 2 for Computers)
    21  	KiB = 1024 * BYTE
    22  	MiB = 1024 * KiB
    23  	GiB = 1024 * MiB
    24  	TiB = 1024 * GiB
    25  	PiB = 1024 * TiB
    26  	EiB = 1024 * PiB
    27  	ZiB = 1024 * EiB
    28  	YiB = 1024 * ZiB
    29  )