1package cunits
2
3// Byte represent a byte
4const Byte = 8
5
6// Decimal prefix of bits
7const (
8	// Kbit represents a kilobit
9	Kbit = 1000
10	// Mbit represents a megabit
11	Mbit = 1000000
12	// Gbit represents a gigabit
13	Gbit = 1000000000
14	// Tbit represents a terabit
15	Tbit = 1000000000000
16	// Pbit represents a petabit
17	Pbit = 1000000000000000
18	// Ebit represents an exabit
19	Ebit = 1000000000000000000
20	// Zbit represents a zettabit (overflows int64)
21	Zbit = 1000000000000000000000
22	// Ybit represents a yottabit (overflows int64)
23	Ybit = 1000000000000000000000000
24)
25
26// Binary prefix of bits
27const (
28	// Kibit represents a kibibit
29	Kibit = 1 << 10
30	// Mibit represents a mebibit
31	Mibit = 1 << 20
32	// Gibit represents a gibibit
33	Gibit = 1 << 30
34	// Tibit represents a tebibit
35	Tibit = 1 << 40
36	// Pibit represents a pebibit
37	Pibit = 1 << 50
38	// Eibit represents an exbibit
39	Eibit = 1 << 60
40	// Zibit represents a zebibit (overflows int64)
41	Zibit = 1 << 70
42	// Yibit represents a yobibit (overflows int64)
43	Yibit = 1 << 80
44)
45
46// Decimal prefix of bytes
47const (
48	// KB represents a kilobyte
49	KB = Kbit * Byte
50	// MB represents a megabyte
51	MB = Mbit * Byte
52	// GB represents a gigabyte
53	GB = Gbit * Byte
54	// TB represents a terabyte
55	TB = Tbit * Byte
56	// PB represents a petabyte
57	PB = Pbit * Byte
58	// EB represents an exabyte
59	EB = Ebit * Byte
60	// ZB represents a zettabyte (overflows int64)
61	ZB = Zbit * Byte
62	// YB represents a yottabyte (overflows int64)
63	YB = Ybit * Byte
64)
65
66// Binary prefix of bytes
67const (
68	// KiB represents a kibibyte
69	KiB = Kibit * Byte
70	// MiB represents a mebibyte
71	MiB = Mibit * Byte
72	// GiB represents a gibibyte
73	GiB = Gibit * Byte
74	// TiB represents a tebibyte
75	TiB = Tibit * Byte
76	// PiB represents a pebibyte
77	PiB = Pibit * Byte
78	// EiB represents an exbibyte (overflows int64)
79	EiB = Eibit * Byte
80	// ZiB represents a zebibyte (overflows int64)
81	ZiB = Zbit * Byte
82	// YiB represents a yobibyte (overflows int64)
83	YiB = Ybit * Byte
84)
85