Skip to content

Instantly share code, notes, and snippets.

View niksaak's full-sized avatar
⛑️
I CAN'T REPAIR THIS M3 TACTICAL HELMET, SIR

Mikola Samardak niksaak

⛑️
I CAN'T REPAIR THIS M3 TACTICAL HELMET, SIR
View GitHub Profile
@niksaak
niksaak / playground.rs
Created December 12, 2017 10:32 — forked from anonymous/playground.rs
Rust code shared from the playground
use std::str;
fn main() {
let b = "67e5504410b1426f9247bb680e5fe0c8";
let mut bytes = [0u8; 16];
for (dest, chunk) in bytes.iter_mut().zip(b.as_bytes().chunks(2)) {
let s = match str::from_utf8(chunk) {
Ok(v) => v,
Err(e) => panic!("Invalid UTF-8 sequence: {}", e),