Похожие чаты

Hi, I've a general doubt. I've big few tokens that I

need to store in cookies, but it's like 4.2KB. which I can't do.

So thought abt compressing n putting data in cookie,

After compressing the data goes down to 2.9kb.
But after making it as base64 string, to put it in cookie, size increases to 3.9kb.

Which is like 200bytes less than initial size. And is prone to fail when tokens size increases somehow.

Can anyone throw some lead on this?

Using nodejs,

11 ответов

42 просмотра

Base64 increases data size by 33%. It does this by taking the bit string of the data, splitting it into chunks of 6 (right-padding with 0s if necessary), and encoding these as 8 bits. 8 is 33% larger than 6. The advantage of Base64 is that all these 8-bit chunks represent printable characters, and none of them are control characters. This makes it safer to pass through systems not designed for binary data, and also makes it easily copyable. But as you noticed, it does NOT reduce the data size, nor does it try to.

Which compression algorithm are you using?

I would try compressing with brotli first, then serializing it into ascii85 instead of base64

_sooraj_-SP Автор вопроса
_sooraj_ SP
Using zlib. Deflate.

Yeah that's gonna be pretty shit

_sooraj_ SP
Using zlib. Deflate.

Do you have any sample data you can send?

_sooraj_-SP Автор вопроса
Thomas
Do you have any sample data you can send?

It's AWS cognito tokens basically. Accesstoken, idToken and refreshtoken

_sooraj_ SP
It's AWS cognito tokens basically. Accesstoken, i...

cognito tokens should be handled by cognito sdk

_sooraj_-SP Автор вопроса
Thomas
Got an example? I don't use AWS

https://pastebin.com/MkV5CaJ7

Похожие вопросы

Обсуждают сегодня

Господа, а что сейчас вообще с рынком труда на делфи происходит? Какова ситуация?
Rꙮman Yankꙮvsky
29
А вообще, что может смущать в самой Julia - бы сказал, что нет единого стандартного подхода по многим моментам, поэтому многое выглядит как "хаки" и произвол. Короче говоря, с...
Viktor G.
2
@Benzenoid can you tell me the easiest, and safest way to bu.y HEX now?
Živa Žena
20
This is a question from my wife who make a fortune with memes 😂😂 About the Migration and Tokens: 1. How will the old tokens be migrated to the new $LGCYX network? What is th...
🍿 °anton°
2
30500 за редактор? )
Владимир
47
а через ESC-код ?
Alexey Kulakov
29
What is the Dex situation? Agora team started with the Pnetwork for their dex which helped them both with integration. It’s completed but as you can see from the Pnetwork ann...
Ben
1
Гайс, вопрос для разносторонее развитых: читаю стрим с юарта, нада выделять с него фреймы с определенной структурой, если ли чо готовое, или долбаться с ринг буффером? нада у...
Vitaly
9
Anyone knows where there are some instructions or discort about failed bridge transactions ?
Jochem
21
@lozuk how do I get my phex copies of my ehex from a atomic wallet, to move to my rabby?
Justfrontin 👀
11
Карта сайта