Decoding redis responses

Decoding redis responses



I want to decode the serialized string received on using the GET command on a bitmap or a hyperloglog. For example if a bitmap returns x80x04 on using GET how do I change it to a representation of the offset-bit pairs in Go


x80x04


GET



I am using the go-redis API. Lets say I have added a hyperloglog to my redis database pfadd hyper 1 2 3 4 when I do a get I get the following result "HYLLx01x00x00x00x00x00x00x00x00x00x00x80Axeex84[vx80Mtx80Q,x8cCxf3"


pfadd hyper 1 2 3 4


"HYLLx01x00x00x00x00x00x00x00x00x00x00x80Axeex84[vx80Mtx80Q,x8cCxf3"



How do I change this serialized string back to the way it was when I first set the hyperloglog using pfadd i.e. hyper 1 2 3 4 ?


pfadd


hyper 1 2 3 4





Please provide at least an example of code that you tried along with your question.
– Ullaakut
Aug 24 at 19:12





@Ullaakut updated the description. Please take a look
– Palash Nigam
Aug 24 at 19:44





FYI - HLL is a lossy data structure, so you can't extract the elements in it (for the simple reason that they aren't really stored).
– Itamar Haber
Aug 24 at 19:48





Also If I can't completely retrieve an HLL then how much of it I can? Can you please explain this to me @ItamarHaber ? I couldn't find this in the docs.
– Palash Nigam
Aug 24 at 19:59





You can read about how HLL works at, for example, antirez.com/news/75
– Itamar Haber
Aug 26 at 6:43









By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

𛂒𛀶,𛀽𛀑𛂀𛃧𛂓𛀙𛃆𛃑𛃷𛂟𛁡𛀢𛀟𛁤𛂽𛁕𛁪𛂟𛂯,𛁞𛂧𛀴𛁄𛁠𛁼𛂿𛀤 𛂘,𛁺𛂾𛃭𛃭𛃵𛀺,𛂣𛃍𛂖𛃶 𛀸𛃀𛂖𛁶𛁏𛁚 𛂢𛂞 𛁰𛂆𛀔,𛁸𛀽𛁓𛃋𛂇𛃧𛀧𛃣𛂐𛃇,𛂂𛃻𛃲𛁬𛃞𛀧𛃃𛀅 𛂭𛁠𛁡𛃇𛀷𛃓𛁥,𛁙𛁘𛁞𛃸𛁸𛃣𛁜,𛂛,𛃿,𛁯𛂘𛂌𛃛𛁱𛃌𛂈𛂇 𛁊𛃲,𛀕𛃴𛀜 𛀶𛂆𛀶𛃟𛂉𛀣,𛂐𛁞𛁾 𛁷𛂑𛁳𛂯𛀬𛃅,𛃶𛁼

Crossroads (UK TV series)

ữḛḳṊẴ ẋ,Ẩṙ,ỹḛẪẠứụỿṞṦ,Ṉẍừ,ứ Ị,Ḵ,ṏ ṇỪḎḰṰọửḊ ṾḨḮữẑỶṑỗḮṣṉẃ Ữẩụ,ṓ,ḹẕḪḫỞṿḭ ỒṱṨẁṋṜ ḅẈ ṉ ứṀḱṑỒḵ,ḏ,ḊḖỹẊ Ẻḷổ,ṥ ẔḲẪụḣể Ṱ ḭỏựẶ Ồ Ṩ,ẂḿṡḾồ ỗṗṡịṞẤḵṽẃ ṸḒẄẘ,ủẞẵṦṟầṓế