yggdrasil/src/util/mod.rs

33 lines
1.2 KiB
Rust

/*
* Yggdrasil: Minecraft authentication server
* Copyright (C) 2023 0xf8.dev@proton.me
*
* This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
use std::time::UNIX_EPOCH;
pub use config::Config;
pub use database::Database;
pub use database::DatabaseWrapper;
pub use input::Input;
pub use validate::Validate;
mod config;
mod database;
mod input;
mod validate;
pub mod errors;
pub mod structs;
// TODO: fix signing
// https://github.com/RustCrypto/RSA/blob/master/tests/proptests.rs
// mod signing;
pub fn get_unix_timestamp() -> u128 {
std::time::SystemTime::now().duration_since(UNIX_EPOCH).expect("Time went backwards?!").as_millis()
}