Post Reply 
PNG to Base64 string
12-27-2018, 08:23 AM (This post was last modified: 12-27-2018 09:31 AM by Didier Lachieze.)
Post: #6
RE: PNG to Base64 string
(12-27-2018 05:27 AM)Jacob Wall Wrote:  For anyone more familiar with these things; is there a quicker and simpler way to get from {137, 80, 78} to {34, 21, 1, 14} on the HP Prime? Any suggestions would be appreciated.

Here is how I would do it :

Code:
L0:={137,80,78}; L1:={};
N:=L0(1)*256^2+L0(2)*256+L0(3);
FOR I FROM 3 DOWNTO 0 DO
  L1(0):=IP(N/64^I);
  N:=N-L1(0)*64^I;
END;

L1 will return {34,21,1,14}, but you can also do the lookup and build the Base64 string directly in the loop rather than building L1.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
PNG to Base64 string - Jacob Wall - 12-22-2018, 03:24 AM
RE: PNG to Base64 string - Jacob Wall - 12-22-2018, 08:30 PM
RE: PNG to Base64 string - Jacob Wall - 12-27-2018, 05:09 AM
RE: PNG to Base64 string - Jacob Wall - 12-27-2018, 05:27 AM
RE: PNG to Base64 string - Didier Lachieze - 12-27-2018 08:23 AM
RE: PNG to Base64 string - Jacob Wall - 12-27-2018, 06:47 PM
RE: PNG to Base64 string - ijabbott - 12-27-2018, 06:16 AM
RE: PNG to Base64 string - Jacob Wall - 12-27-2018, 06:35 PM
RE: PNG to Base64 string - chromos - 12-27-2018, 08:41 PM



User(s) browsing this thread: 1 Guest(s)