Verifying SHA-256 of a file #3933
-
|
I'm trying to write my first Hurl (version 5.0.1) script to validate a proxy for a MaxMind API proxy.
What I want do to is retrieve the SHA256 file, saved the SHA and then request the actual file and compare checksums. This fails as follows: Basically I can't work out how to resolve this issue to convert the bytes into a string or vice-versa. Thank you in advance for any help! |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
|
Hi @mdodds-cns Unfortunately I don't think we have implemented what you need! We have a decode filter that convert bytes to string given an encoding. But that's not exactly what you want, you want a filter that convert hexadecimal representation string to bytes. What we could do either:
I quite like the third solution, as it fits into the As your use case is a rather common use case, I think we're going to address it soon. @fabricereix @lepapareil any preferences? In the meantime, you can still hardcode the |
Beta Was this translation helpful? Give feedback.
-
|
Thanks for investigating this! It does feel like this would be a useful enhancement for Hurl as this is a common pattern when downloading files. |
Beta Was this translation helpful? Give feedback.
-
|
Ho @mdodds-cns The filter |
Beta Was this translation helpful? Give feedback.
Hi @mdodds-cns
Unfortunately I don't think we have implemented what you need!
We have a decode filter that convert bytes to string given an encoding. But that's not exactly what you want, you want a filter that convert hexadecimal representation string to bytes.
What we could do either:
fromHexorfromHexString: this way you could do:toStringfilter on bytes to convert back to an hexadecimal string representationdecodecould accept the encodinghexso th…