StringToBase64 (String function): Difference between revisions

From m204wiki
Jump to navigation Jump to search
mNo edit summary
 
m (→‎See also: link repair)
 
(33 intermediate revisions by 5 users not shown)
Line 1: Line 1:
This [[Intrinsic classes|intrinsic]] function returns the base-64 encoded value of the method object string. 
{{Template:String:StringToBase64 subtitle}}
                                                                                                             
StringToBase64 is available as of version 7.2 of the [[Sirius Mods]].                                         
===StringToBase64 syntax===                                                                                   
  %outStr = string:StringToBase64                                                                            
===Syntax Terms===                                                                                           
<dl>                                                                                                         
<dt>%outStr                                                                                                   
<dd>A string variable to receive the base-64 encoded value of the method object string.                       
<dt>string                                                                                                   
<dd>The string to be base-64 encoded.                                                                         
                                                                                                             
</dl>                                                                                                         
===Usage Notes===                                                                                             
*Base-64 encoding is useful for encoding strings that might contain binary or other characters that could cause problems in certain contexts. For example, binary characters can be problematic when sent in e-mail. <br>Base-64 encoding is an alternative to hexadecimal encoding. Hexadecimal encoding has the advantage that it's simpler, but as the disadvantage that it requires two bytes for every encoded byte. Base-64 encoding, because it uses more characters (64, as the name would suggest), only requires four bytes for every three encoded bytes.                       
*A complete explanation of base-64 encoding can be easily found on the Internet or in many software textbooks.
*The StringToBase64 function returns the standard base-64 encoding of a  string, where the encoded string is padded out to an even multiple of four bytes by appending equal signs.                                                                               
*The inverse of StringToBase64 is [[Base64toString (String function)|Base64toString]]


===Examples===                                                                                               
The <var>StringToBase64</var> [[Intrinsic classes|intrinsic]] function returns the base64 encoded value of the method object string.
                                                                                                             
The following statement displays ''''8PHy8/T19vf4+Q=='''':
    [[PrintText statement|printText]] {'0123456789':stringTobase64}


===See also===                                                      
==Syntax==
[[List of Intrinsic String Methods]]
{{Template:String:StringToBase64 syntax}}
===Syntax terms===
<table class="syntaxTable">
<tr><th>%outString</th>
<td>A string variable to receive the base64 encoded value of the method object <var class="term">string</var>.</td></tr>
<tr><th>string</th>
<td>The string to be base64 encoded.</td></tr>
</table>


[[Category:Intrinsic String methods|StringToBasic64 function]]
==Usage notes==
[[Category:Intrinsic methods]]
<ul><li>A complete explanation of base64 encoding can be easily found on the Internet or in many software textbooks.
[[Category:System methods]]
<li>Base64 encoding is useful for encoding strings that might contain binary or other characters that could cause problems in certain contexts. For example, binary characters can be problematic when sent in e-mail.<li>Base64 encoding is an alternative to hexadecimal encoding. Hexadecimal encoding has the advantage that it's simpler, but as the disadvantage that it requires two bytes for every encoded byte. Base64 encoding, because it uses more characters (64, as the name would suggest), only requires four bytes for every three encoded bytes.
<li>The <var>StringToBase64</var> function returns the standard base64 encoding of a  string, where the encoded string is padded out to an even multiple of four bytes by appending equals signs.
<li><var>StringToBase64</var> is available as of <var class="product">Janus SOAP</var> Version 7.2.</ul>
 
==Examples==
The following statement displays <code>8PHy8/T19vf4+Q==</code>:
<p class="code">[[PrintText statement|printText]] {'0123456789':stringTobase64}
</p>
 
==See also==
<ul>
<li>The inverse of <var>StringToBase64</var> is [[Base64ToString (String function)|Base64ToString]]
</ul>
 
{{Template:String:StringToBase64 footer}}

Latest revision as of 22:29, 25 April 2018

Convert an Ebcdic string to base 64 (String class)


The StringToBase64 intrinsic function returns the base64 encoded value of the method object string.

Syntax

%outString = string:StringToBase64

Syntax terms

%outString A string variable to receive the base64 encoded value of the method object string.
string The string to be base64 encoded.

Usage notes

  • A complete explanation of base64 encoding can be easily found on the Internet or in many software textbooks.
  • Base64 encoding is useful for encoding strings that might contain binary or other characters that could cause problems in certain contexts. For example, binary characters can be problematic when sent in e-mail.
  • Base64 encoding is an alternative to hexadecimal encoding. Hexadecimal encoding has the advantage that it's simpler, but as the disadvantage that it requires two bytes for every encoded byte. Base64 encoding, because it uses more characters (64, as the name would suggest), only requires four bytes for every three encoded bytes.
  • The StringToBase64 function returns the standard base64 encoding of a string, where the encoded string is padded out to an even multiple of four bytes by appending equals signs.
  • StringToBase64 is available as of Janus SOAP Version 7.2.

Examples

The following statement displays 8PHy8/T19vf4+Q==:

printText {'0123456789':stringTobase64}

See also