feat: v1.7.13
This commit is contained in:
2
Cargo.lock
generated
2
Cargo.lock
generated
@@ -1866,7 +1866,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "tiny-encrypt"
|
name = "tiny-encrypt"
|
||||||
version = "1.7.12"
|
version = "1.7.13"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"aes-gcm-stream",
|
"aes-gcm-stream",
|
||||||
"base64",
|
"base64",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "tiny-encrypt"
|
name = "tiny-encrypt"
|
||||||
version = "1.7.12"
|
version = "1.7.13"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
description = "A simple and tiny file encrypt tool"
|
description = "A simple and tiny file encrypt tool"
|
||||||
|
|||||||
@@ -214,7 +214,7 @@ pub fn read_number(hint: &str, from: usize, to: usize) -> usize {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn is_tiny_enc_file(filename: &str) -> bool {
|
pub fn is_tiny_enc_file(filename: &str) -> bool {
|
||||||
return filename.ends_with(TINY_ENC_FILE_EXT) || filename.ends_with(TINY_ENC_PEM_FILE_EXT);
|
filename.ends_with(TINY_ENC_FILE_EXT) || filename.ends_with(TINY_ENC_PEM_FILE_EXT)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn get_user_agent() -> String {
|
pub fn get_user_agent() -> String {
|
||||||
@@ -291,9 +291,11 @@ pub fn ratio(numerator: u64, denominator: u64) -> String {
|
|||||||
format!("{:.2}", r as f64 / 100f64)
|
format!("{:.2}", r as f64 / 100f64)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[allow(clippy::declare_interior_mutable_const)]
|
||||||
const CTRL_C_SET: AtomicBool = AtomicBool::new(false);
|
const CTRL_C_SET: AtomicBool = AtomicBool::new(false);
|
||||||
|
|
||||||
pub fn register_ctrlc() {
|
pub fn register_ctrlc() {
|
||||||
|
#[allow(clippy::borrow_interior_mutable_const)]
|
||||||
if !CTRL_C_SET.load(Ordering::SeqCst) {
|
if !CTRL_C_SET.load(Ordering::SeqCst) {
|
||||||
CTRL_C_SET.store(true, Ordering::SeqCst);
|
CTRL_C_SET.store(true, Ordering::SeqCst);
|
||||||
let _ = ctrlc::set_handler(move || {
|
let _ = ctrlc::set_handler(move || {
|
||||||
|
|||||||
@@ -51,8 +51,8 @@ pub fn gpg_encrypt(key_id: &str, message: &[u8]) -> XResult<String> {
|
|||||||
let gpg_encrypt_result = cmd
|
let gpg_encrypt_result = cmd
|
||||||
.args([
|
.args([
|
||||||
"-e", "-a", "--no-comment",
|
"-e", "-a", "--no-comment",
|
||||||
"-r", &key_id,
|
"-r", key_id,
|
||||||
"--comment", &format!("tiny-encrypt-v{} - {}", env!("CARGO_PKG_VERSION"), &key_id)
|
"--comment", &format!("tiny-encrypt-v{} - {}", env!("CARGO_PKG_VERSION"), key_id)
|
||||||
])
|
])
|
||||||
.stdin(Stdio::piped())
|
.stdin(Stdio::piped())
|
||||||
.stdout(Stdio::piped())
|
.stdout(Stdio::piped())
|
||||||
|
|||||||
Reference in New Issue
Block a user