This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |