-
Notifications
You must be signed in to change notification settings - Fork 522
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add checksum body query (md5, sha1, sha256) #102
Comments
Here are my first remarks: I tend to prefer the third form. It would be interesting to distinguish clearly the string from the binary type.
|
Ok better, but 0xAAAA is foremost a 16 based-integer (it's more an integer representation than a binary representation)
Maybe a
In Python:
or even:
|
Possible formats:
https://www.postgresql.org/docs/9.0/datatype-binary.html
|
We can also unify with body assertions
Is equivalent to:
And could also be represented as:
So in Hurl it's natural to have "binary array literal" :
A checksum assert becomes simply:
And could even be used with a file:
|
Yes! Hurl had already literals for bytearray
It makes sense indeed to extend it with hexadecimal |
It's common to provide a checksum for HTTP resources to be verified.
It could be useful to add a checksum body query in asserts section.
A possible syntax:
Maybe
hash
(vschecksum
) could be a better query name :A third possible syntax: just use the hash algo type
So the possible syntax for the query:
checksum
where can be "sha1", "sha256", "md5"hash
where can be "sha1", "sha256", "md5"The two first has the advantage to be flexible for future algo, the last being more static and more succinct.
Note: the return type of the hash should be a string (lowercase, only 0-9, a-f), as there is no binary type in Hurl (for the moment).
So, while this asserts is syntactically correct, it could never be true:
sha256 equals "zzz"
The text was updated successfully, but these errors were encountered: