rejetto forum

Implementing Base64 encoding/decoding as a Macro function

0 Members and 1 Guest are viewing this topic.

Offline LeoNeeson

  • Tireless poster
  • ****
    • Posts: 700
  • Status: On hiatus (unspecified time)
    • View Profile
    • twitter.com/LeoNeeson
I do not bother to compare or install packages, I just have PAS files accessible in Delphi and functional.
Do you mean it's enough to copy all the PAS files in \Turbo Delphi Portable\lib? Doesn't have to make any other changes to make it work? I would appreciate if you could guide me...
HFS in Spanish (HFS en Español) / How to compile HFS (Tutorial)
» Currently taking a break, until HFS v2.4 get his stable version.


Offline Mars

  • Operator
  • Tireless poster
  • *****
    • Posts: 1985
    • View Profile
it's enough for me to check that minor improvements work for hfs, but I know that basically I can not guarantee an executable free of defects, it's just to propose to rejetto the result of modifications
the only times I share the exe is to show the result we can have to use


Offline LeoNeeson

  • Tireless poster
  • ****
    • Posts: 700
  • Status: On hiatus (unspecified time)
    • View Profile
    • twitter.com/LeoNeeson
it's enough for me to check that minor improvements work for hfs, but I know that basically I can not guarantee an executable free of defects, it's just to propose to rejetto the result of modifications
the only times I share the exe is to show the result we can have to use
:) Yes, I already know that. I was referring if you could help me with Delphi component installation, so I could build HFS by myself. But don't worry, I will investigate on how to install everything and make it work. (I wish I could directly speak french with you, without using a translator, since Google Translator sometimes gives me a bad translation). Sorry if my English is not good...

Have a nice weekend everyone! ;)
(I will log-off of the forum now)
HFS in Spanish (HFS en Español) / How to compile HFS (Tutorial)
» Currently taking a break, until HFS v2.4 get his stable version.


Offline Mars

  • Operator
  • Tireless poster
  • *****
    • Posts: 1985
    • View Profile
it is already very late and I have to get up early, we will continue much later if it does not hurry you  ;)


Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13268
    • View Profile
for my use I would just add aliases  ;D

encode64=base64|$1
decode64=base64decode|$1
encodemd5=md5|$1

I was based on these two macros, encodeuri and decodeuri,  which was in the sense of continuity
do not confuse the md5 and md5 file macros that have different uses

i see, but i don't like having just '64'  instead of 'base64', and the 'encodeuri' name was copied from javascript.


Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13268
    • View Profile
ok, i've found the sha1
Code: [Select]
    if name = 'sha1' then
        result:=SHA1toHex(sha1OfStr(p));

it's not included in beta6, anyway


Offline LeoNeeson

  • Tireless poster
  • ****
    • Posts: 700
  • Status: On hiatus (unspecified time)
    • View Profile
    • twitter.com/LeoNeeson
ok, i've found the sha1
Code: [Select]
    if name = 'sha1' then
        result:=SHA1toHex(sha1OfStr(p));

it's not included in beta6, anyway
Do you mean about SHA1 is not included in beta 6, or also Base64 decode and encode macro? Because I did some test, and it seems Base64 macro was not included on beta 6.
« Last Edit: November 12, 2018, 07:04:44 AM by LeoNeeson »
HFS in Spanish (HFS en Español) / How to compile HFS (Tutorial)
» Currently taking a break, until HFS v2.4 get his stable version.


Offline Mars

  • Operator
  • Tireless poster
  • *****
    • Posts: 1985
    • View Profile

Offline LeoNeeson

  • Tireless poster
  • ****
    • Posts: 700
  • Status: On hiatus (unspecified time)
    • View Profile
    • twitter.com/LeoNeeson
And with {.base64 decode| blablabla.} ??
{.base64 decode| VGhpcyBpcyBhIHNhbXBsZSB0ZXh0.}
No, I've just tried it and it doesn't work. :-[

@Mars: don't forget to read and reply my last private message...  ;)
HFS in Spanish (HFS en Español) / How to compile HFS (Tutorial)
» Currently taking a break, until HFS v2.4 get his stable version.


Offline Mars

  • Operator
  • Tireless poster
  • *****
    • Posts: 1985
    • View Profile
good news, the macro works as indicated by rejetto, I checked the wording in the exe, it's good base64decode
Code: [Select]
{.set|encoded| {.base64|this object will store some %symbols% in the javascript space, so that libs can read them.}.}
{.^encoded.}
<hr>
{.base64decode|{.^encoded.}.}
<hr>
{.base64decode| VGhpcyBpcyBhIHNhbXBsZSB0ZXh0.}
<hr>
{.base64decode|dGhpcyBvYmplY3Qgd2lsbCBzdG9yZSBzb21lICVzeW1ib2xzJSBpbiB0aGUgamF2YXNjcmlwdCBzcGFjZSwgc28gdGhhdCBsaWJzIGNhbiByZWFkIHRoZW0= .}
<hr>

concerning your MP, I took note but it's a big recovery work and my upload is not that high,
  we will have to wait, wait and wait  ;D


Offline LeoNeeson

  • Tireless poster
  • ****
    • Posts: 700
  • Status: On hiatus (unspecified time)
    • View Profile
    • twitter.com/LeoNeeson
good news, the macro works as indicated by rejetto, I checked the wording in the exe, it's good base64decode
Code: [Select]
{.set|encoded| {.base64|this object will store some %symbols% in the javascript space, so that libs can read them.}.}
{.^encoded.}
<hr>
{.base64decode|{.^encoded.}.}
<hr>
{.base64decode| VGhpcyBpcyBhIHNhbXBsZSB0ZXh0.}
<hr>
{.base64decode|dGhpcyBvYmplY3Qgd2lsbCBzdG9yZSBzb21lICVzeW1ib2xzJSBpbiB0aGUgamF2YXNjcmlwdCBzcGFjZSwgc28gdGhhdCBsaWJzIGNhbiByZWFkIHRoZW0= .}
<hr>
Yes, it's working fine now, thanks for the example.

Code: [Select]
[+]
<div style="font-family:tahoma; font-size:12pt;">
{.base64decode| VGhpcyBpcyBhIHNhbXBsZSB0ZXh0.}
</div>
 
HFS in Spanish (HFS en Español) / How to compile HFS (Tutorial)
» Currently taking a break, until HFS v2.4 get his stable version.