[Standards] XEP-0153: Encoding of photo hash?

Tedd Sterr teddsterr at outlook.com
Sun Feb 25 19:45:01 UTC 2018

Igonre the schema - it doesn't appear to be complete or correct. The text & examples make it clear:

"the user's client computes the SHA1 hash of the avatar image data itself (not the base64-encoded version) in accordance with RFC 3174 [4]."

<presence from='juliet at capulet.com/balcony'>
  <x xmlns='vcard-temp:x:update'>

The hash value is the hexadecimal representation of the SHA1 digest (40 characters, representing 20 bytes.)

('not the base64-encoded version' means the hash is calculated from the raw image data, not the base64 version that will be sent.)

The image data is the base64 encoded binary content of the image file.

"The <PHOTO/> element SHOULD contain a <BINVAL/> child whose XML character data is Base64-encoded data for the avatar image."

I've never seen any examples to the contrary; and I suspect no receiving clients would support any such deviations.

From: Standards <standards-bounces at xmpp.org> on behalf of Christian Schudt <christian.schudt at gmx.de>
Sent: 24 February 2018 19:22
To: XMPP Standards
Subject: [Standards] XEP-0153: Encoding of photo hash?

Hi list,

I’ve got a question about XEP-0153. Its XML schema defines that the photo hash is encoded as Base64:

<xs:element name='photo' minOccurs='0' type='xs:base64Binary‘/>

However, I’ve seen the hash encoded as hexadecimal, too. It was no small client, but it was Facebook.
I don’t know how other clients behave.

So I wonder, what is the correct encoding of the photo hash value: base64 or hex-encoded?

Kind regards,
— Christian
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.jabber.org/pipermail/standards/attachments/20180225/970b777b/attachment.html>

More information about the Standards mailing list