fmt uuids

This commit is contained in:
2021-02-13 16:07:45 +01:00
parent fb2505b4b1
commit 7d3765bde1
2 changed files with 6 additions and 6 deletions

View File

@@ -6,11 +6,9 @@ use sodiumoxide::crypto::secretbox;
use std::{borrow::Cow, fmt::Debug};
use uuid::Uuid;
// c7f269be-0ff5-4a77-99c3-7c23c96d5cb4
const DATA_VERSION: Uuid = Uuid::from_u128(0xc7f269be0ff54a7799c37c23c96d5cb4);
const DATA_VERSION: Uuid = Uuid::from_u128(0xc7f269be_0ff5_4a77_99c3_7c23c96d5cb4);
// 5df28591-439a-4cef-8ca6-8433276cc9ed
const KEY_VERSION: Uuid = Uuid::from_u128(0x5df28591439a4cef8ca68433276cc9ed);
const KEY_VERSION: Uuid = Uuid::from_u128(0x5df28591_439a_4cef_8ca6_8433276cc9ed);
pub fn init() {
sodiumoxide::init().expect("sodium init failed");

View File

@@ -4,7 +4,9 @@ use crdt_enc_sodium::EncHandler;
use crdt_enc_tokio::Storage;
use uuid::Uuid;
const CURRENT_DATA_VERSION: Uuid = Uuid::from_u128(1u128);
const CURRENT_DATA_VERSION: Uuid = Uuid::from_u128(0xaadfd5a6_6e19_4b24_a802_4fa27c72f20c);
const SUPPORTED_DATA_VERSIONS: [Uuid; 1] = [CURRENT_DATA_VERSION];
#[tokio::main(flavor = "current_thread")]
async fn main() -> Result<()> {
@@ -20,7 +22,7 @@ async fn main() -> Result<()> {
cryptor,
key_cryptor,
create: true,
supported_data_versions: [CURRENT_DATA_VERSION].iter().cloned().collect(),
supported_data_versions: SUPPORTED_DATA_VERSIONS.iter().cloned().collect(),
current_data_version: CURRENT_DATA_VERSION,
};
let (repo, info) = crdt_enc::Core::open(open_options).await?;