Skip to content

Instantly share code, notes, and snippets.

import sys
import hashlib
def get_file_md5(filepath):
hash_md5 = hashlib.md5()
with open(filepath, "rb") as f:
for chunk in iter(lambda: f.read(4096), b""):
hash_md5.update(chunk)
return hash_md5.hexdigest()
@delarco
delarco / guessing_game.rs
Created February 7, 2024 11:48
Rust Guessing Game
use rand::Rng;
use std::cmp::Ordering;
use std::io;
fn main() {
const MIN_NUMBER: u32 = 1;
const MAX_NUMBER: u32 = 100;
let secret_number = rand::thread_rng().gen_range(MIN_NUMBER..=MAX_NUMBER);