Skip to content

Instantly share code, notes, and snippets.

@boyle-michael
boyle-michael / main.rs
Created February 17, 2026 14:54
rustinterview main.rs for interview
use std::collections::HashMap;
use std::io::{BufRead, BufReader, Write};
use std::mem::MaybeUninit;
use std::net::{TcpListener, TcpStream};
use std::sync::{Arc, Mutex};
use sha1::{Sha1, Digest};
unsafe fn write_bytes(ptr: *mut u8, bytes: &[u8]) {
std::ptr::copy_nonoverlapping(bytes.as_ptr(), ptr, bytes.len());
}