add url{e,d}
This commit is contained in:
parent
1a9404b0c8
commit
d7969dc4b7
4 changed files with 40 additions and 0 deletions
7
Cargo.lock
generated
7
Cargo.lock
generated
|
@ -155,6 +155,7 @@ dependencies = [
|
|||
"base64",
|
||||
"dirs",
|
||||
"rand",
|
||||
"urlencoding",
|
||||
"walkdir",
|
||||
]
|
||||
|
||||
|
@ -204,6 +205,12 @@ version = "1.0.12"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b"
|
||||
|
||||
[[package]]
|
||||
name = "urlencoding"
|
||||
version = "2.1.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "daf8dba3b7eb870caf1ddeed7bc9d2a049f3cfdfae7cb521b087cc33ae4c49da"
|
||||
|
||||
[[package]]
|
||||
name = "walkdir"
|
||||
version = "2.5.0"
|
||||
|
|
|
@ -12,3 +12,4 @@ base64 = "0.22.1"
|
|||
walkdir = "2.5.0"
|
||||
rand = "0.8.5"
|
||||
dirs = "5.0.1"
|
||||
urlencoding = "2.1.3"
|
||||
|
|
16
src/bin/urld.rs
Normal file
16
src/bin/urld.rs
Normal file
|
@ -0,0 +1,16 @@
|
|||
use std::error;
|
||||
use rutils::*;
|
||||
use urlencoding::decode_binary;
|
||||
|
||||
fn main() -> Result<(), Box<dyn error::Error>> {
|
||||
let inputs = get_input()?;
|
||||
let mut first = true;
|
||||
|
||||
for input in inputs {
|
||||
let out = decode_binary(input.as_slice());
|
||||
print(out.into_owned().as_slice(), first)?;
|
||||
first = false;
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
16
src/bin/urle.rs
Normal file
16
src/bin/urle.rs
Normal file
|
@ -0,0 +1,16 @@
|
|||
use std::error;
|
||||
use rutils::*;
|
||||
use urlencoding::encode_binary;
|
||||
|
||||
fn main() -> Result<(), Box<dyn error::Error>> {
|
||||
let inputs = get_input()?;
|
||||
let mut first = true;
|
||||
|
||||
for input in inputs {
|
||||
let out = encode_binary(input.as_slice());
|
||||
print(out.as_bytes(), first)?;
|
||||
first = false;
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
Loading…
Reference in a new issue