ejabberd icon indicating copy to clipboard operation
ejabberd copied to clipboard

implementing 0084 XMPP

Open devendrawebdeveloper opened this issue 8 years ago • 4 comments

Hello ,

We are implementing Avatar Publish(0084 XMPP). Do you have any idea, what is sha_key ? How can we generate in javascript ?

var iq = $iq({ // type: 'set', // }).c('pubsub', { // xmlns: 'http://jabber.org/protocol/pubsub' // }).c('publish', { // node: 'urn:xmpp:avatar:data' // }).c('item', { // id: sha_key // }).c('data',dataURL.replace(/^data:image\/(png|jpg|jpeg);base64,/, ''), { // xmlns: 'urn:xmpp:avatar:data' // });

devendrawebdeveloper avatar Dec 28 '17 10:12 devendrawebdeveloper

It's sha-1 sum of image data that you are publishing (calculated from raw value not from base64 encoded version). You could use https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto/digest for calculating that, but there should be plenty on pure js libraries that implement it if you search for it, if you are interested in having code for that in browser which doesn't have SubtleCrypto.

prefiks avatar Dec 28 '17 10:12 prefiks

Okay Can you please give us any example?

Image to SHA-1 SUM

devendrawebdeveloper avatar Dec 28 '17 11:12 devendrawebdeveloper

Sorry no, i don't work as frontend for google search

prefiks avatar Dec 28 '17 11:12 prefiks

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

lock[bot] avatar Jun 10 '19 00:06 lock[bot]