rejetto forum

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

Offline Mars

  • Operator
  • Tireless poster
  • *****
  • Posts: 1986
    • View Profile
Re: base64 Re: Responsive small screen template
« on: October 31, 2018, 09:58:01 PM »

But I was wondering if is it possible make HFS decode Base64 'on-the-fly' using a macro like: {.mime|text/css;base64.}

Also, neither of the following works:

Code: [Select]

Code: [Select]

I'm curious to know if this is possible using macros. ???

it would be enough simply to add this in scriptlib.pas before 'encodeuri'

    if name = 'encode64' then

    if name = 'decode64' then

including OverbyteicsMD5and OverbyteicsSha1 in the uses,we can allow two other codifications

   if name = 'encodemd5' then

    if name = 'encodesha1' then

the latter two can be used to code the sending of a verification code or password

a wacky example as how encrypt download url and redirect it to be managed in a section

   {.if|{.=|%item-type%|folder.}|<a href="%item-url%">|<a href="/~download?name=%item-name%&id={.encode64|%item-full-url%.}&md5={.encodemd5|%item-url%.}">.}

[download|no log]
<html lang="en-US">
        <meta charset="UTF-8">
        <meta http-equiv="refresh" content="0; url={.decode64|{.urlvar|id.}.}">
        <script type="text/javascript">
            window.location.href = "{.decode64|{.urlvar|id.}.}"
        <title>Page Redirection</title>
        <!-- Note: don't tell people to `click` the link, just tell them that it is a link. -->
        If you are not redirected automatically, follow this <a href='{.decode64|{.urlvar|id.}.}'>direct link </a>.

Follow members gave a thank to your post:

Thank-o-Matic 3.0 By Adk Team