🪟 Windows TippsThe Gemini desktop app is now available for Windows(11.09.2026 um 17:06 Uhr)
🪟 Windows TippsHeader and Footer not showing in Excel(14.09.2026 um 22:43 Uhr)
🕵️ SicherheitslückenBurn Out, Or Fade Away(14.09.2026 um 14:25 Uhr)
🪟 Windows TippsKB5129194 Windows 11 26H1 Out of Band Update - Deskmodder.de(14.09.2026 um 19:25 Uhr)
🪟 Windows TippsThe Gemini desktop app is now available for Windows(11.09.2026 um 17:06 Uhr)
🪟 Windows TippsHeader and Footer not showing in Excel(14.09.2026 um 22:43 Uhr)
🕵️ SicherheitslückenBurn Out, Or Fade Away(14.09.2026 um 14:25 Uhr)
🪟 Windows TippsKB5129194 Windows 11 26H1 Out of Band Update - Deskmodder.de(14.09.2026 um 19:25 Uhr)

🔧 Programmierung 🕛 vor 1 Jahr 2 Min Lesezeit
0

For the first time ever Rust helps me with my personal problem!🦀

↗ Quelle (dev.to)
🗣️ Stimme:

Today, I received an email from GitHub asking me to set up two-factor authentication (2FA) for my account.



During the setup, GitHub provided me with backup codes in case I ever needed to recover my account.



The platform suggested I write these codes down or print them out and delete the text file, as it’s not safe to store them on my computer.



When I looked at the backup codes, I noticed they were made up of 32 words and while writing it down I realised that these are hexadecimal numbers.



Suddenly, I had an idea: "Why not convert these hex numbers into decimals too and write them down?"



At first, I thought of using an online hexadecimal-to-decimal converter, but I realized it would take at least 30 minutes to convert all 32 codes manually.



Then it hit me: "I know Rust! Why not write a small program to do this for me?"



So, I opened my editor and wrote a simple Rust program that reads the backup codes from a text file, processes them, and converts them from hexadecimal to decimal.



Here's the code I came up with:




CODE
use std::fs;

const PATH: &str = "test.txt";

fn main() {
let text: String = fs::read_to_string(PATH).unwrap();

let mut code_vec_str: Vec<&str> = Vec::new();

text.lines()
.for_each(|line| {
line.split('-')
.for_each(|code| code_vec.push(code))
});

let mut num_code: Vec<u32> = Vec::new();

for code in code_vec {
num_code.push(u32::from_str_radix(code, 16).unwrap());
}

println!("{:?}", num_code);
}






And just like that, in no time, I had my list of decimal numbers!



It was such a small program, but it saved me time and effort.



For me, this was a big achievement because it was the first time I used programming to solve a real-life problem.



This experience reminded me why learning a programming language like Rust is so valuable.



Even the smallest piece of code can make a big difference and solve real problems.



So, whether it's Rust or another language, start learning, and soon enough, you’ll find yourself using it in ways you never expected!



I hope this gives you a little motivation to keep your programming journey going.



Have a great day.



Happy Rust Journey!🦀

Vollständiger Original-Bericht
Ausführliche Details, Code-Beispiele & Hersteller-Stellungnahme auf dev.to.
↗ Original-Artikel auf dev.to lesen
Wie bewertest du diesen Beitrag?
1 Klick Feedback
Teilen mit Netzwerk & Team:

Community-Analysen & Experten-Meinungen 0

Verfasse deine eigene Analyse, teile Workarounds oder diskutiere diesen Vorfall im Blog.
Noch keine Community-Analyse verfasst. Markiere einen Textabschnitt oder klicke oben auf Eigene Analyse verfassen“!
Community Pulse: Relevanz-Einschätzung
1 Klick Experten-Votum
🔴 Akute Relevanz 0%
🟡 In Evaluierung 0%
🟢 Keine Auswirkung 0%
Spannende Innovation 0%
Verwandte Story-Cluster & Quellen (Vektor-KI)
Port 8095 Engine
1 Quelle
The Gemini desktop app is now available for Windows
1 Quelle
Header and Footer not showing in Excel
1 Quelle
Burn Out, Or Fade Away
Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten For the first time ever Rust helps me with my personal problem!🦀

Thematisch verwandte Begriffe: first, time, ever, Rust · 6 Treffer

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...