feat: v1.8.0, simple-encrypt and simple-decrypt
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
use std::io::Write;
|
||||
use std::io::{Read, Write};
|
||||
use std::path::{Path, PathBuf};
|
||||
use std::sync::atomic::{AtomicBool, Ordering};
|
||||
use std::{fs, io};
|
||||
@@ -32,6 +32,13 @@ impl AsRef<[u8]> for SecVec {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn read_stdin() -> XResult<Vec<u8>> {
|
||||
let mut buffer = vec![];
|
||||
let mut stdin = io::stdin();
|
||||
opt_result!(stdin.read_to_end(&mut buffer), "Read stdin failed: {}");
|
||||
Ok(buffer)
|
||||
}
|
||||
|
||||
pub fn read_pin(pin: &Option<String>) -> XResult<String> {
|
||||
let rpin = match pin {
|
||||
Some(pin) => pin.to_string(),
|
||||
|
||||
Reference in New Issue
Block a user