Skip to content

Commit

Permalink
Merge pull request #11 from chardon55/no-chrono
Browse files Browse the repository at this point in the history
Remove chrono
  • Loading branch information
chardoncs authored Feb 9, 2024
2 parents c60f80e + 24267cd commit 85a64ac
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 275 deletions.
265 changes: 0 additions & 265 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ homepage = "https://github.com/chardon55/minotp"

[dependencies]
hmac = "0.12"
chrono = { version = "0.4", optional = true }

[dev-dependencies]
data-encoding = "2.5.0"
Expand All @@ -28,5 +27,4 @@ sha3 = { version = "0.10", default-features = false }

[features]
default = []
chrono = ["dep:chrono"]

8 changes: 0 additions & 8 deletions src/util.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#[cfg(not(feature = "chrono"))]
use std::time::{SystemTime, UNIX_EPOCH};

const ENS_BIT: usize = 8;
Expand Down Expand Up @@ -30,13 +29,6 @@ pub(crate) fn calc_totp_counter(interval: u32, timestamp: u64) -> (u64, u32) {
}

#[inline]
#[cfg(feature = "chrono")]
pub(crate) fn time_now() -> u64 {
chrono::Utc::now().timestamp() as u64
}

#[inline]
#[cfg(not(feature = "chrono"))]
pub(crate) fn time_now() -> u64 {
SystemTime::now()
.duration_since(UNIX_EPOCH)
Expand Down

0 comments on commit 85a64ac

Please sign in to comment.