Difference: 0LASubrConvertToBase64 (3 vs. 4)

Revision 42022-04-29 - BrianRyan

Line: 1 to 1
 
META TOPICPARENT name="APPXRuntimeSubroutineAPI"
Changed:
<
<

.CONVERT NUM TO HEX PR

>
>

.CONVERT TO BASE64

 
Changed:
<
<
This subroutine converts a decimal number to a hex pair of alpha characters.
>
>
This subroutine converts Appx raw data to Base64 data.
 
Changed:
<
<

>
>

 

Usage:

Changed:
<
<
    PASS        <hex pair>                FIELD           SHARE? Y
    PASS        <decimal_number>          FIELD           SHARE? N
    GOSUB   --- .CONVERT NUM TO HEX PR

>
>
    PASS        <base64 data>             FIELD           SHARE? Y
    PASS        <raw data>                FIELD           SHARE? N
    PASS        <length to encode>        FIELD           SHARE? N
    GOSUB   --- .CONVERT TO BASE64

  * Check for errors
Changed:
<
<
IF --- .CONVERT NUM TO HEX PR NE
>
>
IF --- .CONVERT TO BASE64 NE
 

Description:

Changed:
<
<
This subroutine converts a number to a hex pair of alpha characters. Both parameters are required, the subroutine will CANCEL if they are not PASSed.
>
>
This subroutine converts Appx raw data to Base64 data. All parameters are required, the subroutine will CANCEL if they are not PASSed.
 
Changed:
<
<
<hex_pair> returns the hexidecimal equivalent of <decimal_number> (Required). This must be PASSed with Share "Y" to return the result.
>
>
<base64 data> is the location to put the data converted to base64 (Required). This must be PASSed with Share "Y" to return the result.
 
Changed:
<
<
<decimal_number> is the value you want converted (Required). This be an integer in the range 0-255.
>
>
<raw data> is the location of the raw data to be converted to base64 data (Required).
 
Changed:
<
<
If you want to convert a string of characters to hexidecimal, see .CONVERT BYTES TO HEX. To convert a hexidecimal number to decimal, see .CONVERT HEX PR TO NUM.
>
>
<length to encode> is the number of bytes to encode to base64 (Required). This is an integer in the range of 1-24000.

If you want to convert base64 data to raw data, see .CONVERT FROM BASE64.

 

Comments:

Read what other users have said about this page or add your own comments.


<--/commentPlugin-->
Deleted:
<
<
-- PeteBrower - 2011-08-12
 \ No newline at end of file
Added:
>
>
-- BrianRyan - 2022-04-29
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback