Unofficial LSL Reference

[[functions:llbase64tointeger]]


Unofficial LSL reference

User Tools

Login

You are currently not logged in! Enter your authentication credentials below to log in. You need to have cookies enabled to log in.

Login

Forgotten your password? Get a new one: Set new password

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

functions:llbase64tointeger [2015-01-31 20:53 SLT]
sei link to Base64 article
functions:llbase64tointeger [2016-12-12 14:59 SLT] (current)
sei Hyphen in "non-zero".
Line 6: Line 6:
 </​code>​ </​code>​
  
-Converts a string containing an integer in [[/lsl/Base64]] representation to integer. Base64 is a fairly compact way to store any arbitrary 32-bit integer in a string, especially if the numbers can usually be big.+Converts a string containing an integer in $lart[Base64] representation to integer. ​$art[Base64is a fairly compact way to store any arbitrary 32-bit integer in a string, especially if the numbers can usually be big.
  
 ===== Parameters ===== ===== Parameters =====
  
 === base64str === === base64str ===
-A [[types/string]] expressed in Base64 that represents the four bytes of a 32-bit integer.+$lty[string] expressed in $lart[Base64that represents the four bytes of a 32-bit integer.
  
 ===== Return value ===== ===== Return value =====
  
-The [[types/integer]] that the string represents, or zero if the string is more than 8 characters long.+The $lty[integer] that the string represents, or zero if the string is more than 8 characters long.
  
 ===== Notes ===== ===== Notes =====
  
   * Strings with more than 8 characters cause the output to be 0.   * Strings with more than 8 characters cause the output to be 0.
-  * Padding is ignored; parsing proceeds until the first non-Base64 character is found. +  * Padding is ignored; parsing proceeds until the first non-$art[Base64character is found. 
-  * The implementation converts from Base64 to a string of bytes, and appends a null byte at the end. If the result has less than four bytes, garbage bytes from whatever the server'​s memory had in these places ​will result. +  * The implementation converts from $art[Base64to a string of bytes, and appends a null byte at the end. If the result has less than four bytes, garbage bytes will result. 
-  * The bytes in the binary form of the Base64 string are always interpreted in big endian order (most-significant byte first). Extra nonzero ​trailing bits in the last Base64 digit are accepted and ignored. Incomplete bytes are not output, e.g. a string with one single character acts as an empty string.+  * The bytes in the binary form of the $art[Base64string are always interpreted in big endian order (most-significant byte first). Extra non-zero ​trailing bits in the last $art[Base64digit are accepted and ignored. Incomplete bytes are not output, e.g. a string with one single character acts as an empty string.
  
 ===== Short examples ===== ===== Short examples =====
Line 46: Line 46:
 ===== See also ===== ===== See also =====
  
-  * [[llIntegerToBase64]] encodes an integer in the Base64 format that this function decodes. +  * $lfn[llIntegerToBase64] encodes an integer in the $lart[Base64format that this function decodes. 
-  * [[llBase64ToString]] and [[llStringToBase64]] convert to/from a UTF-8 encoded string instead of integer. +  * $lfn[llBase64ToString] and $lfn[llStringToBase64] convert to/from a UTF-8 encoded string instead of integer. 
-  * [[llXorBase64]] calculates the bitwise XOR of corresponding bytes represented by two Base 64 strings, byte by byte.+  * $lfn[llXorBase64] calculates the bitwise XOR of corresponding bytes represented by two $art[Base64] ​strings, byte by byte.