nushell/crates/nu-command/src/strings/encode_decode/mod.rs
uaeio d0aa69bfcb
Decode and Encode hex (#8392)
# Description

I need a command that will transform hex string into bytes and into
other direction.

I've implemented `decode hex` command and `encode hex` command. (Based
on `encode base64` and `decode base64` commands
# User-Facing Changes

```
> '010203' | decode hex
0x[01 02 03]
```

and 

```
> 0x[01 02 0a] | encode hex
'01020A'
```

---------

Co-authored-by: whiteand <andrewbeletskiy@gmail.com>
2023-03-24 12:25:26 +01:00

17 lines
350 B
Rust

mod base64;
mod decode;
mod decode_base64;
mod decode_hex;
mod encode;
mod encode_base64;
mod encode_hex;
mod encoding;
mod hex;
pub use self::decode::Decode;
pub use self::decode_base64::DecodeBase64;
pub use self::decode_hex::DecodeHex;
pub use self::encode::Encode;
pub use self::encode_base64::EncodeBase64;
pub use self::encode_hex::EncodeHex;