Improve md5 and sha256 code (#3841)

* Refactor Hash code to simplify md5 and sha256 implementations

Md5 and Sha256 (and other future digests) require less boilerplate code
now. Error reporting includues the name of the hash again.

* Add missing hash sha256 test
This commit is contained in:
Peter Cunderlik
2021-07-29 16:22:16 +01:00
committed by GitHub
parent 7f7af2bbaa
commit 9696e4d315
5 changed files with 100 additions and 74 deletions

View File

@ -84,8 +84,8 @@ pub fn create_default_context(interactive: bool) -> Result<EvaluationContext, Bo
// Text manipulation
whole_stream_command(Hash),
whole_stream_command(HashBase64),
whole_stream_command(HashMd5),
whole_stream_command(HashSha256),
whole_stream_command(HashMd5::default()),
whole_stream_command(HashSha256::default()),
whole_stream_command(Split),
whole_stream_command(SplitColumn),
whole_stream_command(SplitRow),