Skip to content

Verifying SHA-256 of a file #3933

Answered by jcamiel
mdodds-cns asked this question in Q&A
Discussion options

You must be logged in to vote

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:

  1. Add a new filter fromHex or fromHexString: this way you could do:
expected_sha256: body regex "([a-f0-9]{64})\\s+[^\\s]+" fromHex
...
sha256 == {{expected_sha256}}
  1. Or implement toString filter on bytes to convert back to an hexadecimal string representation
expected_sha256: body regex "([a-f0-9]{64})\\s+[^\\s]+"
...
sha256 toString == {{expected_sha256}}
  1. Or decode could accept the encoding hex so th…

Replies: 3 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Answer selected by jcamiel
Comment options

You must be logged in to vote
1 reply
@jcamiel
Comment options

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants