feat: Add functionality to read path from stdin and rund tasks
This commit is contained in:
parent
43bea77392
commit
52dca1bcaf
5 changed files with 29 additions and 17 deletions
|
|
@ -2,7 +2,12 @@ use crate::utils::poly::{self, coefficient_to_binary};
|
|||
use base64::prelude::*;
|
||||
use serde_json::Value;
|
||||
|
||||
pub fn poly2block(coefficients: Vec<u8>) -> String {
|
||||
pub fn poly2block(args: &Value) -> String {
|
||||
let coefficients: Vec<u8> = args["coefficients"]
|
||||
.as_array()
|
||||
.unwrap()
|
||||
.into_iter()
|
||||
.map(|x| x.as_u64().unwrap() as u8)
|
||||
.collect();
|
||||
BASE64_STANDARD.encode(poly::coefficient_to_binary(coefficients).to_ne_bytes())
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue