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
[package] | |
name = "shallenge" | |
version = "0.1.0" | |
edition = "2021" | |
[dependencies] | |
sha2 = "0.11.0-pre.3" |
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 chrono::Local; | |
use std::io::Write; | |
use std::net::{TcpListener, TcpStream}; | |
fn handle_client(mut stream: TcpStream) { | |
let dt = Local::now().to_utc(); | |
stream.write_all(dt.to_string().as_bytes()).unwrap(); | |
stream.shutdown(std::net::Shutdown::Both).unwrap(); | |
} |
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
#!/usr/bin/env python3 | |
import uuid as _uuid | |
import argparse | |
from itertools import batched | |
from pylibdmtx.pylibdmtx import encode | |
size = 18 | |
size_with_margin = size + 4 | |
encoding = "Base256" |
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
#!/usr/bin/env python3 | |
import argparse | |
import shortuuid | |
from itertools import batched | |
from pylibdmtx.pylibdmtx import encode | |
padding = 5 | |
output_svg_width = 25 | |
output_svg_height = 25 |
OlderNewer