move folder

This commit is contained in:
2022-01-02 23:46:08 +01:00
parent 835f7df0f6
commit a0732a4593
58 changed files with 73 additions and 83 deletions

27
backend/src/note/model.rs Normal file
View File

@@ -0,0 +1,27 @@
use bs62;
use ring::rand::SecureRandom;
use serde::{Deserialize, Serialize};
#[derive(Serialize, Deserialize, Clone)]
pub struct Note {
pub meta: String,
pub contents: String,
pub views: Option<u8>,
pub expiration: Option<u32>,
}
#[derive(Serialize, Deserialize, Clone)]
pub struct NoteInfo {}
#[derive(Serialize, Deserialize, Clone)]
pub struct NotePublic {
pub meta: String,
pub contents: String,
}
pub fn generate_id() -> String {
let mut id: [u8; 32] = [0; 32];
let sr = ring::rand::SystemRandom::new();
let _ = sr.fill(&mut id);
return bs62::encode_data(&id);
}