[Standards] XEP-231 Bits of Binary
christian.schudt at gmx.de
Sat May 31 18:28:39 UTC 2014
I am currently reading and implementing XEP-231 Bits of Binary and stumbled upon a possible bug:
I noticed, that the SHA-1 hash "8f35fef110ffc5df08d579a50083ff9308fb6242", which is used in the examples,
is the hash of the used Base64 string ("iVBORw0KGgoAAA…..").
The description of the "cid" attribute says:
the "hash" is the hex output of the algorithm applied to the binary data itself.
Do we need to calculate the hash from the Base64 String or from the underlying binary data?
i.e. the examples have used something like (in Java code):
sha1 ( base64String.getBytes() )
and the description suggests something like:
sha1 ( Base64.decode(base64String) ) or just directly using sha1( byteArray )
Thanks for clarification!
More information about the Standards