1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
pub const KILOBYTE: u128 = 1000;
pub const KIBIBYTE: u128 = 1024;
pub const MEGABYTE: u128 = 1000000;
pub const MEBIBYTE: u128 = 1048576;
pub const GIGABYTE: u128 = 1000000000;
pub const GIBIBYTE: u128 = 1073741824;
pub const TERABYTE: u128 = 1000000000000;
pub const TEBIBYTE: u128 = 1099511627776;
pub const PETABYTE: u128 = 1000000000000000;
pub const PEBIBYTE: u128 = 1125899906842624;
pub const EXABYTE: u128 = 1000000000000000000;
pub const EXBIBYTE: u128 = 1152921504606846976;
pub const ZETTABYTE: u128 = 1000000000000000000000;
pub const ZEBIBYTE: u128 = 1180591620717411303424;
#[inline]
pub const fn n_kb_bytes(bytes: u128) -> u128 {
bytes * KILOBYTE
}
#[inline]
pub const fn n_kib_bytes(bytes: u128) -> u128 {
bytes * KIBIBYTE
}
#[inline]
pub const fn n_mb_bytes(bytes: u128) -> u128 {
bytes * MEGABYTE
}
#[inline]
pub const fn n_mib_bytes(bytes: u128) -> u128 {
bytes * MEBIBYTE
}
#[inline]
pub const fn n_gb_bytes(bytes: u128) -> u128 {
bytes * GIGABYTE
}
#[inline]
pub const fn n_gib_bytes(bytes: u128) -> u128 {
bytes * GIBIBYTE
}
#[inline]
pub const fn n_tb_bytes(bytes: u128) -> u128 {
bytes * TERABYTE
}
#[inline]
pub const fn n_tib_bytes(bytes: u128) -> u128 {
bytes * TEBIBYTE
}
#[inline]
pub const fn n_pb_bytes(bytes: u128) -> u128 {
bytes * PETABYTE
}
#[inline]
pub const fn n_pib_bytes(bytes: u128) -> u128 {
bytes * PEBIBYTE
}
#[inline]
pub const fn n_eb_bytes(bytes: u128) -> u128 {
bytes * EXABYTE
}
#[inline]
pub const fn n_eib_bytes(bytes: u128) -> u128 {
bytes * EXBIBYTE
}
#[inline]
pub const fn n_zb_bytes(bytes: u128) -> u128 {
bytes * ZETTABYTE
}
#[inline]
pub const fn n_zib_bytes(bytes: u128) -> u128 {
bytes * ZEBIBYTE
}