LlBase64ToInteger
Looking for the current API? Open the llBase64ToInteger reference →
Return value notes
Caveats
- If
strcontains fewer than 6 characters, any incomplete least-significant bytes of the integer are set to 0.- For example, the Base64 value
"qqqqqq=="corresponds to the hexadecimal value0xAAAAAAAA. If the padding "=" characters and the last "q" are dropped, there are 5*6=30 bits remaining and those can form only 3 full bytes (24 bits). The result is0xAAAAAA00. - The Base64 value
"qqqq"has 4*6=24 bits available, which is enough for the same 3 full bytes. The result is also0xAAAAAA00. - Similarly, 3-character Base64 has 18 bits, enough for 2 bytes, and 2-character Base64 has 12 bits, enough for one byte.
- Finally, single-character Base64 has only 6 bits and thus no complete bytes, and the result is always zero.
- For example, the Base64 value
- Returns zero if
stris longer than 8 characters.
Examples
integer value = llBase64ToInteger("3q0AAA==");
// writes out -559087616
llOwnerSay((string)value);See also: functions
See also: articles
Original wiki source
Some wiki templates and tables need their original context. View this article on the Second Life Wiki. Technical wording and examples are retained from the source; historical guidance may differ from current behavior.