feat: implement first task as file

This commit is contained in:
0xalivecow 2024-10-18 20:28:30 +02:00
parent 27acd0a531
commit 64fe182fc3
No known key found for this signature in database
9 changed files with 70 additions and 19 deletions

View file

@ -0,0 +1 @@
mod tasks01;

View file

@ -0,0 +1,7 @@
use crate::utils::poly;
use base64::prelude::*;
fn block2poly(block: String) {
let num_block: u128 = BASE64_STANDARD.decode(block).unwrap().into();
let coefficients = poly::get_bit_indices_from_byte();
}

2
src/tasks/tasks01/mod.rs Normal file
View file

@ -0,0 +1,2 @@
mod poly2block;
mod block2poly;

View file

@ -0,0 +1,7 @@
use crate::utils::poly::{self, coefficient_to_binary};
use base64::prelude::*;
use serde_json::Value;
pub fn poly2block(coefficients: Vec<u8>) -> String {
BASE64_STANDARD.encode(poly::coefficient_to_binary(coefficients).to_ne_bytes())
}