hakanai-lib 2.13.2

Client library for Hakanai, a secure secret sharing service.
Documentation
1
2
3
4
5
6
7
8
9
10
// SPDX-License-Identifier: Apache-2.0

use std::time::{SystemTime, UNIX_EPOCH};

/// Returns the current timestamp in seconds since the Unix epoch.
pub fn now_string() -> Result<String, std::time::SystemTimeError> {
    let now = SystemTime::now();
    let duration = now.duration_since(UNIX_EPOCH)?;
    Ok(format!("{}", duration.as_secs()))
}