{"sha":"db6aed9d8a7c5f3dbff56e73a7aa9fdfb0727e67","node_id":"C_kwDORGOyr9oAKGRiNmFlZDlkOGE3YzVmM2RiZmY1NmU3M2E3YWE5ZmRmYjA3MjdlNjc","commit":{"author":{"name":"Akaalroop Singh","email":"akaal@akaalroop.com","date":"2026-02-01T17:56:32Z"},"committer":{"name":"Akaalroop Singh","email":"akaal@akaalroop.com","date":"2026-02-01T17:56:32Z"},"message":"Add the actual working generator of the codes","tree":{"sha":"40ed5722af8375c7667a2c28d82f99ea6276a06c","url":"https://api.github.com/repos/Spacexplorer11/TOTP-Generator/git/trees/40ed5722af8375c7667a2c28d82f99ea6276a06c"},"url":"https://api.github.com/repos/Spacexplorer11/TOTP-Generator/git/commits/db6aed9d8a7c5f3dbff56e73a7aa9fdfb0727e67","comment_count":0,"verification":{"verified":true,"reason":"valid","signature":"-----BEGIN PGP SIGNATURE-----\n\niHUEABYKAB0WIQSyaufsnFqHrxTYH/OT+WDO0HlQCAUCaX+T0QAKCRCT+WDO0HlQ\nCGrCAP9F+QPnpvIoaRXwnPJHxC852G28ydDQspZtlMkHecYXIgEA5ffypT5YLNKp\nPZBFOuY1PZkN3WzzKhqYoXiGsjRh/wE=\n=Td/U\n-----END PGP SIGNATURE-----","payload":"tree 40ed5722af8375c7667a2c28d82f99ea6276a06c\nparent a887f56a0b8a9e732eda09d42de977c4798da23e\nauthor Akaalroop Singh <akaal@akaalroop.com> 1769968592 +0000\ncommitter Akaalroop Singh <akaal@akaalroop.com> 1769968592 +0000\n\nAdd the actual working generator of the codes\n","verified_at":"2026-02-01T17:56:39Z"}},"url":"https://api.github.com/repos/Spacexplorer11/TOTP-Generator/commits/db6aed9d8a7c5f3dbff56e73a7aa9fdfb0727e67","html_url":"https://github.com/Spacexplorer11/TOTP-Generator/commit/db6aed9d8a7c5f3dbff56e73a7aa9fdfb0727e67","comments_url":"https://api.github.com/repos/Spacexplorer11/TOTP-Generator/commits/db6aed9d8a7c5f3dbff56e73a7aa9fdfb0727e67/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":"a887f56a0b8a9e732eda09d42de977c4798da23e","url":"https://api.github.com/repos/Spacexplorer11/TOTP-Generator/commits/a887f56a0b8a9e732eda09d42de977c4798da23e","html_url":"https://github.com/Spacexplorer11/TOTP-Generator/commit/a887f56a0b8a9e732eda09d42de977c4798da23e"}],"stats":{"total":165,"additions":165,"deletions":0},"files":[{"sha":"7bc91eafa3ddff2da5d8d8508a766bdac528013a","filename":".idea/rust.xml","status":"added","additions":6,"deletions":0,"changes":6,"blob_url":"https://github.com/Spacexplorer11/TOTP-Generator/blob/db6aed9d8a7c5f3dbff56e73a7aa9fdfb0727e67/.idea%2Frust.xml","raw_url":"https://github.com/Spacexplorer11/TOTP-Generator/raw/db6aed9d8a7c5f3dbff56e73a7aa9fdfb0727e67/.idea%2Frust.xml","contents_url":"https://api.github.com/repos/Spacexplorer11/TOTP-Generator/contents/.idea%2Frust.xml?ref=db6aed9d8a7c5f3dbff56e73a7aa9fdfb0727e67","patch":"@@ -0,0 +1,6 @@\n+<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n+<project version=\"4\">\n+  <component name=\"RsVcsConfiguration\">\n+    <option name=\"rustFmt\" value=\"true\" />\n+  </component>\n+</project>\n\\ No newline at end of file"},{"sha":"f856d5536d99cb8bfe35a55b3f883ee26eb45973","filename":"Cargo.lock","status":"modified","additions":138,"deletions":0,"changes":138,"blob_url":"https://github.com/Spacexplorer11/TOTP-Generator/blob/db6aed9d8a7c5f3dbff56e73a7aa9fdfb0727e67/Cargo.lock","raw_url":"https://github.com/Spacexplorer11/TOTP-Generator/raw/db6aed9d8a7c5f3dbff56e73a7aa9fdfb0727e67/Cargo.lock","contents_url":"https://api.github.com/repos/Spacexplorer11/TOTP-Generator/contents/Cargo.lock?ref=db6aed9d8a7c5f3dbff56e73a7aa9fdfb0727e67","patch":"@@ -5,3 +5,141 @@ version = 4\n [[package]]\n name = \"TOTP-Generator\"\n version = \"0.1.0\"\n+dependencies = [\n+ \"totp-rs\",\n+]\n+\n+[[package]]\n+name = \"base32\"\n+version = \"0.5.1\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"022dfe9eb35f19ebbcb51e0b40a5ab759f46ad60cadf7297e0bd085afb50e076\"\n+\n+[[package]]\n+name = \"block-buffer\"\n+version = \"0.10.4\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71\"\n+dependencies = [\n+ \"generic-array\",\n+]\n+\n+[[package]]\n+name = \"cfg-if\"\n+version = \"1.0.4\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801\"\n+\n+[[package]]\n+name = \"constant_time_eq\"\n+version = \"0.3.1\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"7c74b8349d32d297c9134b8c88677813a227df8f779daa29bfc29c183fe3dca6\"\n+\n+[[package]]\n+name = \"cpufeatures\"\n+version = \"0.2.17\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280\"\n+dependencies = [\n+ \"libc\",\n+]\n+\n+[[package]]\n+name = \"crypto-common\"\n+version = \"0.1.7\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"78c8292055d1c1df0cce5d180393dc8cce0abec0a7102adb6c7b1eef6016d60a\"\n+dependencies = [\n+ \"generic-array\",\n+ \"typenum\",\n+]\n+\n+[[package]]\n+name = \"digest\"\n+version = \"0.10.7\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292\"\n+dependencies = [\n+ \"block-buffer\",\n+ \"crypto-common\",\n+ \"subtle\",\n+]\n+\n+[[package]]\n+name = \"generic-array\"\n+version = \"0.14.7\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a\"\n+dependencies = [\n+ \"typenum\",\n+ \"version_check\",\n+]\n+\n+[[package]]\n+name = \"hmac\"\n+version = \"0.12.1\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e\"\n+dependencies = [\n+ \"digest\",\n+]\n+\n+[[package]]\n+name = \"libc\"\n+version = \"0.2.180\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"bcc35a38544a891a5f7c865aca548a982ccb3b8650a5b06d0fd33a10283c56fc\"\n+\n+[[package]]\n+name = \"sha1\"\n+version = \"0.10.6\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba\"\n+dependencies = [\n+ \"cfg-if\",\n+ \"cpufeatures\",\n+ \"digest\",\n+]\n+\n+[[package]]\n+name = \"sha2\"\n+version = \"0.10.9\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"a7507d819769d01a365ab707794a4084392c824f54a7a6a7862f8c3d0892b283\"\n+dependencies = [\n+ \"cfg-if\",\n+ \"cpufeatures\",\n+ \"digest\",\n+]\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 = \"totp-rs\"\n+version = \"5.7.0\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"f124352108f58ef88299e909f6e9470f1cdc8d2a1397963901b4a6366206bf72\"\n+dependencies = [\n+ \"base32\",\n+ \"constant_time_eq\",\n+ \"hmac\",\n+ \"sha1\",\n+ \"sha2\",\n+]\n+\n+[[package]]\n+name = \"typenum\"\n+version = \"1.19.0\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"562d481066bde0658276a35467c4af00bdc6ee726305698a55b86e61d7ad82bb\"\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\""},{"sha":"6f56fc07225976a12e4926b96cb3336f4b2a0144","filename":"Cargo.toml","status":"modified","additions":1,"deletions":0,"changes":1,"blob_url":"https://github.com/Spacexplorer11/TOTP-Generator/blob/db6aed9d8a7c5f3dbff56e73a7aa9fdfb0727e67/Cargo.toml","raw_url":"https://github.com/Spacexplorer11/TOTP-Generator/raw/db6aed9d8a7c5f3dbff56e73a7aa9fdfb0727e67/Cargo.toml","contents_url":"https://api.github.com/repos/Spacexplorer11/TOTP-Generator/contents/Cargo.toml?ref=db6aed9d8a7c5f3dbff56e73a7aa9fdfb0727e67","patch":"@@ -4,3 +4,4 @@ version = \"0.1.0\"\n edition = \"2024\"\n \n [dependencies]\n+totp-rs = { version = \"5.7.0\"}"},{"sha":"51a28db99fb673db8a752f03d7aa661e96c1b5b3","filename":"src/main.rs","status":"modified","additions":20,"deletions":0,"changes":20,"blob_url":"https://github.com/Spacexplorer11/TOTP-Generator/blob/db6aed9d8a7c5f3dbff56e73a7aa9fdfb0727e67/src%2Fmain.rs","raw_url":"https://github.com/Spacexplorer11/TOTP-Generator/raw/db6aed9d8a7c5f3dbff56e73a7aa9fdfb0727e67/src%2Fmain.rs","contents_url":"https://api.github.com/repos/Spacexplorer11/TOTP-Generator/contents/src%2Fmain.rs?ref=db6aed9d8a7c5f3dbff56e73a7aa9fdfb0727e67","patch":"@@ -1,6 +1,26 @@\n+use std::io;\n+use totp_rs::{Algorithm, Secret, TOTP};\n+\n fn main() {\n     let title_screen_art = r\"___  __  ___  __      __   ___       ___  __       ___  __   __\n  |  /  \\  |  |__)    / _` |__  |\\ | |__  |__)  /\\   |  /  \\ |__)\n  |  \\__/  |  |       \\__> |___ | \\| |___ |  \\ /~~\\  |  \\__/ |  \\ \";\n     println!(\"{}\", title_screen_art);\n+\n+    println!(\"Enter your secret (Base32 - Only include A-Z & 2-7):\");\n+    let mut secret_str = String::new();\n+\n+    io::stdin()\n+        .read_line(&mut secret_str)\n+        .expect(\"An error occurred while taking input\");\n+\n+    let secret_str = secret_str.trim().replace(\" \", \"\").to_uppercase();\n+    let secret = Secret::Encoded(secret_str)\n+        .to_bytes()\n+        .expect(\"Invalid Base32 secret\");\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 }"}]}