{"sha":"c66d13b715ee4d4e16c09d8ef21acf5553609152","node_id":"C_kwDORGOyr9oAKGM2NmQxM2I3MTVlZTRkNGUxNmMwOWQ4ZWYyMWFjZjU1NTM2MDkxNTI","commit":{"author":{"name":"Akaalroop Singh","email":"akaal@akaalroop.com","date":"2026-02-02T07:48:54Z"},"committer":{"name":"Akaalroop Singh","email":"akaal@akaalroop.com","date":"2026-02-02T07:48:54Z"},"message":"Add the time left for each code no matter when you start the program","tree":{"sha":"50ade04a94705050e58d9ad9811509dd378ee34f","url":"https://api.github.com/repos/Spacexplorer11/TOTP-Generator/git/trees/50ade04a94705050e58d9ad9811509dd378ee34f"},"url":"https://api.github.com/repos/Spacexplorer11/TOTP-Generator/git/commits/c66d13b715ee4d4e16c09d8ef21acf5553609152","comment_count":0,"verification":{"verified":true,"reason":"valid","signature":"-----BEGIN PGP SIGNATURE-----\n\niHUEABYKAB0WIQSyaufsnFqHrxTYH/OT+WDO0HlQCAUCaYBW5wAKCRCT+WDO0HlQ\nCIigAP99myBgqBd/K73/Fk7Fi5aXU2ODaVXUSbwNhV1YtzdnXAEAniCrys23xI8I\nRL5Ez0skAddXxAkizprFnMf6+F0npwI=\n=A3x5\n-----END PGP SIGNATURE-----","payload":"tree 50ade04a94705050e58d9ad9811509dd378ee34f\nparent db6aed9d8a7c5f3dbff56e73a7aa9fdfb0727e67\nauthor Akaalroop Singh <akaal@akaalroop.com> 1770018534 +0000\ncommitter Akaalroop Singh <akaal@akaalroop.com> 1770018534 +0000\n\nAdd the time left for each code no matter when you start the program\n","verified_at":"2026-02-02T07:48:59Z"}},"url":"https://api.github.com/repos/Spacexplorer11/TOTP-Generator/commits/c66d13b715ee4d4e16c09d8ef21acf5553609152","html_url":"https://github.com/Spacexplorer11/TOTP-Generator/commit/c66d13b715ee4d4e16c09d8ef21acf5553609152","comments_url":"https://api.github.com/repos/Spacexplorer11/TOTP-Generator/commits/c66d13b715ee4d4e16c09d8ef21acf5553609152/comments","author":{"login":"Spacexplorer11","id":156950243,"node_id":"U_kgDOCVre4w","avatar_url":"https://avatars.githubusercontent.com/u/156950243?v=4","gravatar_id":"","url":"https://api.github.com/users/Spacexplorer11","html_url":"https://github.com/Spacexplorer11","followers_url":"https://api.github.com/users/Spacexplorer11/followers","following_url":"https://api.github.com/users/Spacexplorer11/following{/other_user}","gists_url":"https://api.github.com/users/Spacexplorer11/gists{/gist_id}","starred_url":"https://api.github.com/users/Spacexplorer11/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Spacexplorer11/subscriptions","organizations_url":"https://api.github.com/users/Spacexplorer11/orgs","repos_url":"https://api.github.com/users/Spacexplorer11/repos","events_url":"https://api.github.com/users/Spacexplorer11/events{/privacy}","received_events_url":"https://api.github.com/users/Spacexplorer11/received_events","type":"User","user_view_type":"public","site_admin":false},"committer":{"login":"Spacexplorer11","id":156950243,"node_id":"U_kgDOCVre4w","avatar_url":"https://avatars.githubusercontent.com/u/156950243?v=4","gravatar_id":"","url":"https://api.github.com/users/Spacexplorer11","html_url":"https://github.com/Spacexplorer11","followers_url":"https://api.github.com/users/Spacexplorer11/followers","following_url":"https://api.github.com/users/Spacexplorer11/following{/other_user}","gists_url":"https://api.github.com/users/Spacexplorer11/gists{/gist_id}","starred_url":"https://api.github.com/users/Spacexplorer11/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Spacexplorer11/subscriptions","organizations_url":"https://api.github.com/users/Spacexplorer11/orgs","repos_url":"https://api.github.com/users/Spacexplorer11/repos","events_url":"https://api.github.com/users/Spacexplorer11/events{/privacy}","received_events_url":"https://api.github.com/users/Spacexplorer11/received_events","type":"User","user_view_type":"public","site_admin":false},"parents":[{"sha":"db6aed9d8a7c5f3dbff56e73a7aa9fdfb0727e67","url":"https://api.github.com/repos/Spacexplorer11/TOTP-Generator/commits/db6aed9d8a7c5f3dbff56e73a7aa9fdfb0727e67","html_url":"https://github.com/Spacexplorer11/TOTP-Generator/commit/db6aed9d8a7c5f3dbff56e73a7aa9fdfb0727e67"}],"stats":{"total":291,"additions":288,"deletions":3},"files":[{"sha":"065efeb2cc1d5b7e2d72f39becf8f3d6be333395","filename":"Cargo.lock","status":"modified","additions":259,"deletions":0,"changes":259,"blob_url":"https://github.com/Spacexplorer11/TOTP-Generator/blob/c66d13b715ee4d4e16c09d8ef21acf5553609152/Cargo.lock","raw_url":"https://github.com/Spacexplorer11/TOTP-Generator/raw/c66d13b715ee4d4e16c09d8ef21acf5553609152/Cargo.lock","contents_url":"https://api.github.com/repos/Spacexplorer11/TOTP-Generator/contents/Cargo.lock?ref=c66d13b715ee4d4e16c09d8ef21acf5553609152","patch":"@@ -6,6 +6,7 @@ version = 4\n name = \"TOTP-Generator\"\n version = \"0.1.0\"\n dependencies = [\n+ \"clearscreen\",\n  \"totp-rs\",\n ]\n \n@@ -15,6 +16,12 @@ version = \"0.5.1\"\n source = \"registry+https://github.com/rust-lang/crates.io-index\"\n checksum = \"022dfe9eb35f19ebbcb51e0b40a5ab759f46ad60cadf7297e0bd085afb50e076\"\n \n+[[package]]\n+name = \"bitflags\"\n+version = \"2.10.0\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"812e12b5285cc515a9c72a5c1d3b6d46a19dac5acfef5265968c166106e31dd3\"\n+\n [[package]]\n name = \"block-buffer\"\n version = \"0.10.4\"\n@@ -30,6 +37,25 @@ version = \"1.0.4\"\n source = \"registry+https://github.com/rust-lang/crates.io-index\"\n checksum = \"9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801\"\n \n+[[package]]\n+name = \"cfg_aliases\"\n+version = \"0.2.1\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724\"\n+\n+[[package]]\n+name = \"clearscreen\"\n+version = \"4.0.3\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"1430e4fe087fa90b9fc465ddbe00b994df4dd2c8a05f8fd5e43815bbf541b2dc\"\n+dependencies = [\n+ \"nix\",\n+ \"terminfo\",\n+ \"thiserror\",\n+ \"which\",\n+ \"windows-sys\",\n+]\n+\n [[package]]\n name = \"constant_time_eq\"\n version = \"0.3.1\"\n@@ -66,6 +92,28 @@ dependencies = [\n  \"subtle\",\n ]\n \n+[[package]]\n+name = \"env_home\"\n+version = \"0.1.0\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"c7f84e12ccf0a7ddc17a6c41c93326024c42920d7ee630d04950e6926645c0fe\"\n+\n+[[package]]\n+name = \"errno\"\n+version = \"0.3.14\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb\"\n+dependencies = [\n+ \"libc\",\n+ \"windows-sys\",\n+]\n+\n+[[package]]\n+name = \"fnv\"\n+version = \"1.0.7\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1\"\n+\n [[package]]\n name = \"generic-array\"\n version = \"0.14.7\"\n@@ -91,6 +139,130 @@ version = \"0.2.180\"\n source = \"registry+https://github.com/rust-lang/crates.io-index\"\n checksum = \"bcc35a38544a891a5f7c865aca548a982ccb3b8650a5b06d0fd33a10283c56fc\"\n \n+[[package]]\n+name = \"linux-raw-sys\"\n+version = \"0.11.0\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"df1d3c3b53da64cf5760482273a98e575c651a67eec7f77df96b5b642de8f039\"\n+\n+[[package]]\n+name = \"memchr\"\n+version = \"2.7.6\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"f52b00d39961fc5b2736ea853c9cc86238e165017a493d1d5c8eac6bdc4cc273\"\n+\n+[[package]]\n+name = \"minimal-lexical\"\n+version = \"0.2.1\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a\"\n+\n+[[package]]\n+name = \"nix\"\n+version = \"0.30.1\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"74523f3a35e05aba87a1d978330aef40f67b0304ac79c1c00b294c9830543db6\"\n+dependencies = [\n+ \"bitflags\",\n+ \"cfg-if\",\n+ \"cfg_aliases\",\n+ \"libc\",\n+]\n+\n+[[package]]\n+name = \"nom\"\n+version = \"7.1.3\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a\"\n+dependencies = [\n+ \"memchr\",\n+ \"minimal-lexical\",\n+]\n+\n+[[package]]\n+name = \"phf\"\n+version = \"0.11.3\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"1fd6780a80ae0c52cc120a26a1a42c1ae51b247a253e4e06113d23d2c2edd078\"\n+dependencies = [\n+ \"phf_shared\",\n+]\n+\n+[[package]]\n+name = \"phf_codegen\"\n+version = \"0.11.3\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"aef8048c789fa5e851558d709946d6d79a8ff88c0440c587967f8e94bfb1216a\"\n+dependencies = [\n+ \"phf_generator\",\n+ \"phf_shared\",\n+]\n+\n+[[package]]\n+name = \"phf_generator\"\n+version = \"0.11.3\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"3c80231409c20246a13fddb31776fb942c38553c51e871f8cbd687a4cfb5843d\"\n+dependencies = [\n+ \"phf_shared\",\n+ \"rand\",\n+]\n+\n+[[package]]\n+name = \"phf_shared\"\n+version = \"0.11.3\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"67eabc2ef2a60eb7faa00097bd1ffdb5bd28e62bf39990626a582201b7a754e5\"\n+dependencies = [\n+ \"siphasher\",\n+]\n+\n+[[package]]\n+name = \"proc-macro2\"\n+version = \"1.0.106\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"8fd00f0bb2e90d81d1044c2b32617f68fcb9fa3bb7640c23e9c748e53fb30934\"\n+dependencies = [\n+ \"unicode-ident\",\n+]\n+\n+[[package]]\n+name = \"quote\"\n+version = \"1.0.44\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"21b2ebcf727b7760c461f091f9f0f539b77b8e87f2fd88131e7f1b433b3cece4\"\n+dependencies = [\n+ \"proc-macro2\",\n+]\n+\n+[[package]]\n+name = \"rand\"\n+version = \"0.8.5\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404\"\n+dependencies = [\n+ \"rand_core\",\n+]\n+\n+[[package]]\n+name = \"rand_core\"\n+version = \"0.6.4\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c\"\n+\n+[[package]]\n+name = \"rustix\"\n+version = \"1.1.3\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"146c9e247ccc180c1f61615433868c99f3de3ae256a30a43b49f67c2d9171f34\"\n+dependencies = [\n+ \"bitflags\",\n+ \"errno\",\n+ \"libc\",\n+ \"linux-raw-sys\",\n+ \"windows-sys\",\n+]\n+\n [[package]]\n name = \"sha1\"\n version = \"0.10.6\"\n@@ -113,12 +285,61 @@ dependencies = [\n  \"digest\",\n ]\n \n+[[package]]\n+name = \"siphasher\"\n+version = \"1.0.2\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"b2aa850e253778c88a04c3d7323b043aeda9d3e30d5971937c1855769763678e\"\n+\n [[package]]\n name = \"subtle\"\n version = \"2.6.1\"\n source = \"registry+https://github.com/rust-lang/crates.io-index\"\n checksum = \"13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292\"\n \n+[[package]]\n+name = \"syn\"\n+version = \"2.0.114\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"d4d107df263a3013ef9b1879b0df87d706ff80f65a86ea879bd9c31f9b307c2a\"\n+dependencies = [\n+ \"proc-macro2\",\n+ \"quote\",\n+ \"unicode-ident\",\n+]\n+\n+[[package]]\n+name = \"terminfo\"\n+version = \"0.9.0\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"d4ea810f0692f9f51b382fff5893887bb4580f5fa246fde546e0b13e7fcee662\"\n+dependencies = [\n+ \"fnv\",\n+ \"nom\",\n+ \"phf\",\n+ \"phf_codegen\",\n+]\n+\n+[[package]]\n+name = \"thiserror\"\n+version = \"2.0.18\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"4288b5bcbc7920c07a1149a35cf9590a2aa808e0bc1eafaade0b80947865fbc4\"\n+dependencies = [\n+ \"thiserror-impl\",\n+]\n+\n+[[package]]\n+name = \"thiserror-impl\"\n+version = \"2.0.18\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"ebc4ee7f67670e9b64d05fa4253e753e016c6c95ff35b89b7941d6b856dec1d5\"\n+dependencies = [\n+ \"proc-macro2\",\n+ \"quote\",\n+ \"syn\",\n+]\n+\n [[package]]\n name = \"totp-rs\"\n version = \"5.7.0\"\n@@ -138,8 +359,46 @@ version = \"1.19.0\"\n source = \"registry+https://github.com/rust-lang/crates.io-index\"\n checksum = \"562d481066bde0658276a35467c4af00bdc6ee726305698a55b86e61d7ad82bb\"\n \n+[[package]]\n+name = \"unicode-ident\"\n+version = \"1.0.22\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"9312f7c4f6ff9069b165498234ce8be658059c6728633667c526e27dc2cf1df5\"\n+\n [[package]]\n name = \"version_check\"\n version = \"0.9.5\"\n source = \"registry+https://github.com/rust-lang/crates.io-index\"\n checksum = \"0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a\"\n+\n+[[package]]\n+name = \"which\"\n+version = \"8.0.0\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"d3fabb953106c3c8eea8306e4393700d7657561cb43122571b172bbfb7c7ba1d\"\n+dependencies = [\n+ \"env_home\",\n+ \"rustix\",\n+ \"winsafe\",\n+]\n+\n+[[package]]\n+name = \"windows-link\"\n+version = \"0.2.1\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5\"\n+\n+[[package]]\n+name = \"windows-sys\"\n+version = \"0.61.2\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc\"\n+dependencies = [\n+ \"windows-link\",\n+]\n+\n+[[package]]\n+name = \"winsafe\"\n+version = \"0.0.19\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"d135d17ab770252ad95e9a872d365cf3090e3be864a34ab46f48555993efc904\""},{"sha":"191df4197c2876327b29b799792e81050a7183d1","filename":"Cargo.toml","status":"modified","additions":1,"deletions":0,"changes":1,"blob_url":"https://github.com/Spacexplorer11/TOTP-Generator/blob/c66d13b715ee4d4e16c09d8ef21acf5553609152/Cargo.toml","raw_url":"https://github.com/Spacexplorer11/TOTP-Generator/raw/c66d13b715ee4d4e16c09d8ef21acf5553609152/Cargo.toml","contents_url":"https://api.github.com/repos/Spacexplorer11/TOTP-Generator/contents/Cargo.toml?ref=c66d13b715ee4d4e16c09d8ef21acf5553609152","patch":"@@ -5,3 +5,4 @@ edition = \"2024\"\n \n [dependencies]\n totp-rs = { version = \"5.7.0\"}\n+clearscreen = \"4.0.3\""},{"sha":"dcf93c391a0d0e06561002579d342daced4514c4","filename":"src/main.rs","status":"modified","additions":28,"deletions":3,"changes":31,"blob_url":"https://github.com/Spacexplorer11/TOTP-Generator/blob/c66d13b715ee4d4e16c09d8ef21acf5553609152/src%2Fmain.rs","raw_url":"https://github.com/Spacexplorer11/TOTP-Generator/raw/c66d13b715ee4d4e16c09d8ef21acf5553609152/src%2Fmain.rs","contents_url":"https://api.github.com/repos/Spacexplorer11/TOTP-Generator/contents/src%2Fmain.rs?ref=c66d13b715ee4d4e16c09d8ef21acf5553609152","patch":"@@ -1,4 +1,5 @@\n-use std::io;\n+use std::time::{Duration, SystemTime, UNIX_EPOCH};\n+use std::{io, thread};\n use totp_rs::{Algorithm, Secret, TOTP};\n \n fn main() {\n@@ -7,6 +8,10 @@ fn main() {\n  |  \\__/  |  |       \\__> |___ | \\| |___ |  \\ /~~\\  |  \\__/ |  \\ \";\n     println!(\"{}\", title_screen_art);\n \n+    println!(\n+        \"Warning: This program clears your terminal after you enter the key, please ensure you have no information you may need later in this terminal session\"\n+    );\n+    println!(\"To abort use CTRL+C\");\n     println!(\"Enter your secret (Base32 - Only include A-Z & 2-7):\");\n     let mut secret_str = String::new();\n \n@@ -21,6 +26,26 @@ fn main() {\n \n     let totp = TOTP::new(Algorithm::SHA1, 6, 1, 30, secret).unwrap();\n \n-    let token = totp.generate_current().unwrap();\n-    println!(\"Current token: {}\", token);\n+    let mut i: u8 = 30;\n+\n+    loop {\n+        let token = totp.generate_current().unwrap();\n+        clearscreen::clear().expect(\"failed to clear screen\");\n+        println!(\"{}\", title_screen_art);\n+        println!(\n+            \"Current token: {} - {} seconds\",\n+            token,\n+            30 - (SystemTime::now()\n+                .duration_since(UNIX_EPOCH)\n+                .unwrap()\n+                .as_secs()\n+                % 30)\n+        );\n+        thread::sleep(Duration::from_secs(1));\n+        if i > 0 {\n+            i -= 1;\n+        } else {\n+            i = 30\n+        }\n+    }\n }"}]}