aboutsummaryrefslogtreecommitdiff
path: root/src/model/k2v
diff options
context:
space:
mode:
authorAlex <alex@adnab.me>2023-01-26 15:17:09 +0000
committerAlex <alex@adnab.me>2023-01-26 15:17:09 +0000
commit5fb383fe4c248181e27df12a57849886e50bacb7 (patch)
tree004e5b3649dd01843b00922e0f5266a1973c0d18 /src/model/k2v
parent1311742fe07ca619d1f37f9f1eabd07ee0d141db (diff)
parent0da054194b7e063b09f1354bcde739247725688b (diff)
downloadgarage-5fb383fe4c248181e27df12a57849886e50bacb7.tar.gz
garage-5fb383fe4c248181e27df12a57849886e50bacb7.zip
Merge pull request 'cargo: Bump dependencies to latest version' (#484) from jpds/garage:cargo-bumps into main
Reviewed-on: https://git.deuxfleurs.fr/Deuxfleurs/garage/pulls/484
Diffstat (limited to 'src/model/k2v')
-rw-r--r--src/model/k2v/causality.rs7
-rw-r--r--src/model/k2v/item_table.rs4
2 files changed, 7 insertions, 4 deletions
diff --git a/src/model/k2v/causality.rs b/src/model/k2v/causality.rs
index 9a692870..62488d53 100644
--- a/src/model/k2v/causality.rs
+++ b/src/model/k2v/causality.rs
@@ -1,3 +1,5 @@
+use base64::prelude::*;
+
use std::collections::BTreeMap;
use std::convert::TryInto;
@@ -41,11 +43,12 @@ impl CausalContext {
bytes.extend(u64::to_be_bytes(i));
}
- base64::encode_config(bytes, base64::URL_SAFE_NO_PAD)
+ BASE64_URL_SAFE_NO_PAD.encode(bytes)
}
/// Parse from base64-encoded binary representation
pub fn parse(s: &str) -> Result<Self, String> {
- let bytes = base64::decode_config(s, base64::URL_SAFE_NO_PAD)
+ let bytes = BASE64_URL_SAFE_NO_PAD
+ .decode(s)
.map_err(|e| format!("bad causality token base64: {}", e))?;
if bytes.len() % 16 != 8 || bytes.len() < 8 {
return Err("bad causality token length".into());
diff --git a/src/model/k2v/item_table.rs b/src/model/k2v/item_table.rs
index ce3e4129..9955a9cd 100644
--- a/src/model/k2v/item_table.rs
+++ b/src/model/k2v/item_table.rs
@@ -173,9 +173,9 @@ impl Crdt for DvvsEntry {
impl PartitionKey for K2VItemPartition {
fn hash(&self) -> Hash {
- use blake2::{Blake2b, Digest};
+ use blake2::{Blake2b512, Digest};
- let mut hasher = Blake2b::new();
+ let mut hasher = Blake2b512::new();
hasher.update(self.bucket_id.as_slice());
hasher.update(self.partition_key.as_bytes());
let mut hash = [0u8; 32];