Deprecate hash base64, extend decode and add encode commands (#5863)

* feat: deprecate `hash base64` command

* feat: extend `decode` and `encode` command families

This commit
- Adds `encode` command family
- Backports `hash base64` features to `encode base64` and `decode base64` subcommands.
- Refactors code a bit and extends tests for encodings
- `decode base64` returns a binary `Value` (that may be decoded into a string using `decode` command)

* feat: add `--binary(-b)` flag to `decode base64`

Default output type is now string, but binary can be requested using this new flag.
This commit is contained in:
Benoît Cortier
2022-06-25 17:35:23 -04:00
committed by GitHub
parent f2989bf704
commit 173d60d59d
16 changed files with 466 additions and 192 deletions

View File

@ -170,6 +170,9 @@ pub fn create_default_context(cwd: impl AsRef<Path>) -> EngineState {
BuildString,
Char,
Decode,
Encode,
DecodeBase64,
EncodeBase64,
DetectColumns,
Format,
FileSize,
@ -382,7 +385,7 @@ pub fn create_default_context(cwd: impl AsRef<Path>) -> EngineState {
Hash,
HashMd5::default(),
HashSha256::default(),
Base64,
HashBase64,
};
// Experimental