samdark / yiiframework-ru

yiiframework.ru
http://yiiframework.ru/
Other
52 stars 21 forks source link

Decoding string in Base45 on Delphi (Pascal) #162

Closed IgorRTTI closed 2 years ago

IgorRTTI commented 2 years ago

Good evening! Sorry, maybe I'm on the wrong topic. I need help in Pascal (Delphi). I couldn't find the source for the Base45 library, so I decided to write it myself. I figured out the encoding of the string, but there was a problem with decoding: If the string has a multiple of 3 characters, then everything works fine. How to get the "remainder", I also found. But what if I have, for example, 8 or 11 characters? How can I combine them? Am I looping correctly for a multiple string? Please correct. ... var M, N : Array of Word; A, B, C, D: Word; I, X, Y, R, W: Word; ... functoin Decode_45(S : string) : string; ... SetLength(M, Length(S)+1); SetLength(N, Length(S)+1); ... I:= 1; repeat A:= M[I]; B:= M[I+1]; C:= M[I+2]; N[I]:= A + (B 45) + (C 45 45); // X:= N[I]; Y:= X div 256; // Первый байт // R:= Y 256; W:= X - R; // Второй байт // REZ:= REZ + Chr(Y) + Chr(W); I:= I + 3; until I > Length(S)-1; ... Result:= REZ;

IgorRTTI commented 2 years ago

What kind of woodpeckers do they use dislikes? What didn't you like? You wouldn't go to shit! I have already solved the problem. You are all American morons, fucking colonists ... Pray to all the damn things that Russia wouldn't give you a pussy.

IgorRTTI commented 2 years ago

Вам не нравится Delphi? Ну так сосите хуй со своим C++. Дебилы блядь, заебали со своей вакциной, колите её себе в задницу 5 раз в день и улыбайтесь. Вирус у вас в голове. Чтоб вы сдохли, суки ёбаные. Это я вам говорю с любовью, чтобы не накликать на себя карму,- карму ненависти и жестокости. В случае войны, я буду вас убивать с любовью...