diff --git a/Cargo.lock b/Cargo.lock index 6869a9a4..9e324301 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1,6 +1,6 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. -version = 3 +version = 4 [[package]] name = "aho-corasick" @@ -146,9 +146,9 @@ checksum = "ec8a7b6a70fde80372154c65702f00a0f56f3e1c36abbc6c440484be248856db" [[package]] name = "bytesize" -version = "1.1.0" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c58ec36aac5066d5ca17df51b3e70279f5670a72102f5752cb7e7c856adfc70" +checksum = "a3c8f83209414aacf0eeae3cf730b18d6981697fba62f200fcfb92b9f082acba" [[package]] name = "cc" diff --git a/crates/fingerprint/Cargo.toml b/crates/fingerprint/Cargo.toml index 558f3750..49ed1123 100644 --- a/crates/fingerprint/Cargo.toml +++ b/crates/fingerprint/Cargo.toml @@ -7,7 +7,7 @@ edition = "2021" [dependencies] anyhow = "1.0" -bytesize = "1.1" +bytesize = "2.0" hostname = "0.3" log = "0.4" os_info = "3.2" diff --git a/crates/fingerprint/src/machine.rs b/crates/fingerprint/src/machine.rs index 197373df..42c6c4ca 100644 --- a/crates/fingerprint/src/machine.rs +++ b/crates/fingerprint/src/machine.rs @@ -55,8 +55,11 @@ impl Machine { // measurement commonly used for memory) but it is unclear whether `sysinfo` is returning KB // or KiB. sys.refresh_memory(); - let memory_total_kb = sys.total_memory(); - let memory = bytesize::to_string(bytesize::ByteSize::kib(memory_total_kb).0, true); + let memory_total_kb = sys.total_memory() / 1024; + let memory = bytesize::ByteSize::kib(memory_total_kb) + .display() + .iec() + .to_string(); // Hash all properties into a unique identifier. let hash = hash::string(&format!(