Author Topic: Implementing Base64 encoding/decoding as a Macro function  (Read 259 times)

0 Members and 1 Guest are viewing this topic.

Offline LeoNeeson

  • Tireless poster
  • ****
  • Posts: 498
  • Solitario...
    • View Profile
    • twitter.com/LeoNeeson
Re: base64 Re: Responsive small screen template
« Reply #15 on: November 03, 2018, 10:42:04 PM »
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 ahora también disponible en Español! (Clic aqui) :)
• HFS is now also available in Spanish! (Click here)

Offline Mars

  • Operator
  • Tireless poster
  • *****
  • Posts: 1859
    • View Profile
Re: base64 Re: Responsive small screen template
« Reply #16 on: November 03, 2018, 10:57:39 PM »
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: 498
  • Solitario...
    • View Profile
    • twitter.com/LeoNeeson
Re: base64 Re: Responsive small screen template
« Reply #17 on: November 03, 2018, 11:08:15 PM »
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 ahora también disponible en Español! (Clic aqui) :)
• HFS is now also available in Spanish! (Click here)

Offline Mars

  • Operator
  • Tireless poster
  • *****
  • Posts: 1859
    • View Profile
Re: base64 Re: Responsive small screen template
« Reply #18 on: November 03, 2018, 11:09:47 PM »
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: 12903
    • View Profile
Re: Implementing Base64 encoding/decoding as a Macro function
« Reply #19 on: November 04, 2018, 09:52:40 PM »
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: 12903
    • View Profile
Re: Implementing Base64 encoding/decoding as a Macro function
« Reply #20 on: November 04, 2018, 10:19:02 PM »
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: 498
  • Solitario...
    • View Profile
    • twitter.com/LeoNeeson
Re: Implementing Base64 encoding/decoding as a Macro function
« Reply #21 on: November 11, 2018, 03:44:04 AM »
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 ahora también disponible en Español! (Clic aqui) :)
• HFS is now also available in Spanish! (Click here)

Offline Mars

  • Operator
  • Tireless poster
  • *****
  • Posts: 1859
    • View Profile
Re: Implementing Base64 encoding/decoding as a Macro function
« Reply #22 on: November 11, 2018, 11:51:47 AM »
And with {.base64 decode| blablabla.} ??

Offline LeoNeeson

  • Tireless poster
  • ****
  • Posts: 498
  • Solitario...
    • View Profile
    • twitter.com/LeoNeeson
Re: Implementing Base64 encoding/decoding as a Macro function
« Reply #23 on: November 11, 2018, 07:34:53 PM »
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 ahora también disponible en Español! (Clic aqui) :)
• HFS is now also available in Spanish! (Click here)

Offline Mars

  • Operator
  • Tireless poster
  • *****
  • Posts: 1859
    • View Profile
Re: Implementing Base64 encoding/decoding as a Macro function
« Reply #24 on: November 11, 2018, 10:42:18 PM »
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: 498
  • Solitario...
    • View Profile
    • twitter.com/LeoNeeson
Re: Implementing Base64 encoding/decoding as a Macro function
« Reply #25 on: November 12, 2018, 07:06:46 AM »
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 ahora también disponible en Español! (Clic aqui) :)
• HFS is now also available in Spanish! (Click here)