Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 5 of 5 total
Thread Base64 Encoding
Fri, May 26 2017 12:38 PMPermanent Link

Mark Brooks

Slikware

Avatar

Can anybody tell me if there's a function to Base64 encode a string, anywhere within the depths of the EWB library?

If not, does anybody have one they might care to share?

Regards
Mark
Fri, May 26 2017 2:32 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Mark,

<< Can anybody tell me if there's a function to Base64 encode a string, anywhere within the depths of the EWB library? >>

No, but I think I'm supposed to be adding one at some point. Wink

Tim Young
Elevate Software
www.elevatesoft.com
Fri, May 26 2017 3:53 PMPermanent Link

Mark Brooks

Slikware

Avatar

>>Tim Young [Elevate Software] wrote:
>>No, but I think I'm supposed to be adding one at some point. Wink

Fantastic! This evening would be ideal!
Sat, May 27 2017 1:05 PMPermanent Link

Raul

Team Elevate Team Elevate

On 5/26/2017 12:38 PM, Mark Brooks wrote:
> Can anybody tell me if there's a function to Base64 encode a string, anywhere within the depths of the EWB library?
>
> If not, does anybody have one they might care to share?

You can use external atob/btoa that generally works fine but may need
some conversion when working with unicode
(https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/atob)

To use in EWB just declare 2 external functions in your unit interface
section:


interface
.....
external function atob(ins:string):string;
external function btoa(ins:string):string;
....
implementation
...
//and then in code call this to encode
Base64String := btoa(RegularString);
//or  this to decode
RegularString := atob(Base64String);


Raul
Sat, May 27 2017 4:24 PMPermanent Link

Mark Brooks

Slikware

Avatar

>> Raul wrote:
>> You can use external atob/btoa that generally works fine but may need

Thanks Raul - most useful
Image