implementing 0084 XMPP
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'
// });
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.
Okay Can you please give us any example?
Image to SHA-1 SUM
Sorry no, i don't work as frontend for google search
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.