fmt uuids
This commit is contained in:
@@ -6,11 +6,9 @@ use sodiumoxide::crypto::secretbox;
|
|||||||
use std::{borrow::Cow, fmt::Debug};
|
use std::{borrow::Cow, fmt::Debug};
|
||||||
use uuid::Uuid;
|
use uuid::Uuid;
|
||||||
|
|
||||||
// c7f269be-0ff5-4a77-99c3-7c23c96d5cb4
|
const DATA_VERSION: Uuid = Uuid::from_u128(0xc7f269be_0ff5_4a77_99c3_7c23c96d5cb4);
|
||||||
const DATA_VERSION: Uuid = Uuid::from_u128(0xc7f269be0ff54a7799c37c23c96d5cb4);
|
|
||||||
|
|
||||||
// 5df28591-439a-4cef-8ca6-8433276cc9ed
|
const KEY_VERSION: Uuid = Uuid::from_u128(0x5df28591_439a_4cef_8ca6_8433276cc9ed);
|
||||||
const KEY_VERSION: Uuid = Uuid::from_u128(0x5df28591439a4cef8ca68433276cc9ed);
|
|
||||||
|
|
||||||
pub fn init() {
|
pub fn init() {
|
||||||
sodiumoxide::init().expect("sodium init failed");
|
sodiumoxide::init().expect("sodium init failed");
|
||||||
|
|||||||
@@ -4,7 +4,9 @@ use crdt_enc_sodium::EncHandler;
|
|||||||
use crdt_enc_tokio::Storage;
|
use crdt_enc_tokio::Storage;
|
||||||
use uuid::Uuid;
|
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")]
|
#[tokio::main(flavor = "current_thread")]
|
||||||
async fn main() -> Result<()> {
|
async fn main() -> Result<()> {
|
||||||
@@ -20,7 +22,7 @@ async fn main() -> Result<()> {
|
|||||||
cryptor,
|
cryptor,
|
||||||
key_cryptor,
|
key_cryptor,
|
||||||
create: true,
|
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,
|
current_data_version: CURRENT_DATA_VERSION,
|
||||||
};
|
};
|
||||||
let (repo, info) = crdt_enc::Core::open(open_options).await?;
|
let (repo, info) = crdt_enc::Core::open(open_options).await?;
|
||||||
|
|||||||
Reference in New Issue
Block a user