Base64 encoder
Base64 encoder
I found that Annex32 now supports base64 decoder. But there is no base64 encoder. Will it be a base64 encoder function built into Annex?
Use case: I am struggling to send binary data, and currently encode to HEX string that cause the data transmission size doubled. Workable but not efficient.
Thank you.
Use case: I am struggling to send binary data, and currently encode to HEX string that cause the data transmission size doubled. Workable but not efficient.
Thank you.
- cicciocb
- Site Admin
- Posts: 2060
- Joined: Mon Feb 03, 2020 1:15 pm
- Location: Toulouse
- Has thanked: 439 times
- Been thanked: 1358 times
- Contact:
Re: Base64 encoder
Yes I'll add the base64 encoder to the list[Local Link Removed for Guests] wrote: [Local Link Removed for Guests]Fri Aug 11, 2023 3:07 pm I found that Annex32 now supports base64 decoder. But there is no base64 encoder. Will it be a base64 encoder function built into Annex?
Use case: I am struggling to send binary data, and currently encode to HEX string that cause the data transmission size doubled. Workable but not efficient.
Thank you.
- cicciocb
- Site Admin
- Posts: 2060
- Joined: Mon Feb 03, 2020 1:15 pm
- Location: Toulouse
- Has thanked: 439 times
- Been thanked: 1358 times
- Contact:
Re: Base64 encoder
Yeay! I see this on the newest help file.
FILE.TOBASE64 source$, dest$
Convert the file defined ‘source$’ into the file defined in ‘dest$’. The source file can be in any format and will be encoded in base64 format.
Thank you for your great effort
FILE.TOBASE64 source$, dest$
Convert the file defined ‘source$’ into the file defined in ‘dest$’. The source file can be in any format and will be encoded in base64 format.
Thank you for your great effort
Re: Base64 encoder
I was trying simple code with ESP32CAM:
The module keeps restarted everytime it runs.
However, if the source file was text, it converted just fine. Does the file.tobase64 has limitation only to text file and cannot work with binary file?
Thank you.
Code: [Local Link Removed for Guests]
wlog camera.picture("/picture.jpg")
file.tobase64 "/picture.jpg", "/picture.txt"
wlog "converted to base64"
However, if the source file was text, it converted just fine. Does the file.tobase64 has limitation only to text file and cannot work with binary file?
Thank you.
- cicciocb
- Site Admin
- Posts: 2060
- Joined: Mon Feb 03, 2020 1:15 pm
- Location: Toulouse
- Has thanked: 439 times
- Been thanked: 1358 times
- Contact:
Re: Base64 encoder
It should work with all the kind of files.[Local Link Removed for Guests] wrote: [Local Link Removed for Guests]Fri Aug 25, 2023 2:01 am I was trying simple code with ESP32CAM:
The module keeps restarted everytime it runs.Code: [Local Link Removed for Guests]
wlog camera.picture("/picture.jpg") file.tobase64 "/picture.jpg", "/picture.txt" wlog "converted to base64"
However, if the source file was text, it converted just fine. Does the file.tobase64 has limitation only to text file and cannot work with binary file?
Thank you.
You are right, it do not work properly.
Ill fix it.
- cicciocb
- Site Admin
- Posts: 2060
- Joined: Mon Feb 03, 2020 1:15 pm
- Location: Toulouse
- Has thanked: 439 times
- Been thanked: 1358 times
- Contact:
Re: Base64 encoder
It has been fixed on the esp32 and esp32-s3.[Local Link Removed for Guests] wrote: [Local Link Removed for Guests]Mon Aug 28, 2023 3:01 am Awaiting AnnexCam new release with fixed binary base64 encoding. Thank you...
I'll release the version for the CAM very soon
-
- Posts: 36
- Joined: Sat Feb 20, 2021 9:36 am
- Location: Sindelfingen, Germany
- Has thanked: 141 times
- Been thanked: 10 times
Re: Base64 encoder
Great[Local Link Removed for Guests] wrote: [Local Link Removed for Guests]Mon Aug 28, 2023 11:15 am
It has been fixed on the esp32 and esp32-s3.
I'll release the version for the CAM very soon