ARSA Language, String, Encryption and Compression operations:
Example:
set( $str,
"Hello World" )
set($str,
string.replacewhitespace(\"\the\tl\nl\ro"\) )
set($tab,
string.replacewhitespace(\"6210612724\t77.55"\))
set( $xml, \"<?
xml version="1.0" encoding="UTF-8"?> <note> <to>Tove</to> <from test="hello world">Jani</from> <heading>Reminder</heading><body>Don't forget me this weekend!</body></note>"\ )
set($json_str1, \"{
"menu": {
"id":
"file",
"value":
"File",
"popup": {
"menuitem": [ {
"value":
"New",
"onclick":
"CreateNewDoc()"}, {
"value":
"Open",
"onclick":
"OpenDoc()"}, {
"value":
"Close",
"onclick":
"CloseDoc()"} ] } }
"\)
// json example 2.
set($json_str2, \" ,"glossary": { "title": "example glossary", "GlossDiv": { "title": "S", "GlossList": { "GlossEntry": { "ID": "SGML", "SortAs": "SGML", "GlossTerm": "Standard Generalized Markup Language", "Acronym": "SGML", "Abbrev": "ISO 8879:1986", "GlossDef": { "para": "A meta-markup language, used to create markup languages such as DocBook.", "GlossSeeAlso": ["GML", "XML"] }, "GlossSee": "markup" } } } } }"\)
set($id,
curl(\
"-X POST -k -d "client_id=hh7ec2.apps.googleusercontent.com&scope=https:
set($str,
"hello - how are you?")
alog(
string.empty($str) )
alog(
string.size($str) )
alog(
string.replacewhitespace(\
"\thello\thow \nare you?"\) )
alog(
string.cat($str,
" [end]") )
alog(
string.erase($str,8) )
alog(
string.replace($str,
"you",
"me") )
alog(
string.charat($str,8) )
alog(
string.upper($str) )
alog(
string.lower($str) )
alog(
string.find($str,
"h") )
alog(
string.findlast($str,
"h") )
alog(
string.findclearfirst($str,
"h") )
alog(
string.findclearlast($str,
"?") )
alog(
string.addprefix($str,
"john: ") )
alog(
string.addsuffix($str,
" [end]") )
alog(
string.tokn($str,2) )
alog(
string.tokn($str,3) )
alog(
string.tokn($str,4) )
alog(
string.binaryencode($str) )
alog(
string.binarydecode(
"0110100001100101011011000110110001101111001000000010110100100000011010000110111101110111001000000110000101110010011001010010000001111001011011110111010100111111") )
alog(
string.decencode($str) )
alog(
string.decdecode(
"104 101 108 108 111 32 45 32 104 111 119 32 97 114 101 32 121 111 117 63") )
alog(
string.hexencode($str) )
alog(
string.hexdecode(
"68656c6c6f202d20686f772061726520796f753f") )
string.tofile( "a.zip", string.compress($str), false, ascii )
alog(
string.crc32($str) )
string.tofile( "b.zip", string.encryption($str, "password"), false, ascii )
string.tofile( "c.zip", string.encryption($str, $random_pass), false, ascii )
alog(
string.decryption(
ftostring(
"c.zip", ascii), $random_pass) )
string.tofile( $dzip, string.zip($str, $alisname, $random_pass), false, ascii )
alog(
string.crc32(
string.unzip(
ftostring($dzip,ascii), $alisname, $random_pass)))
alog(
string.unzip(
ftostring($dzip,ascii), $alisname, $random_pass))
Compression Level 9 and CRC32 Checksum Report:
start...compress level: 9
openfile...core-
for-system-modules.jar size: 1.367 mbs.
checksum crc32...603040bf
compress...
compress used time: 0.224 second. size: 1.148 mbs.
uncompress...
uncompress used time: 0.175 second. size: 1.367 mbs.
passed [OK]
openfile...avcodec-56.dll size: 8.906 mbs.
checksum crc32...7a470602
compress...
compress used time: 1.661 second. size: 4.173 mbs.
uncompress...
uncompress used time: 1.780 second. size: 8.906 mbs.
passed [OK]
openfile...bundletool-all-1.7.0.jar size: 26.714 mbs.
checksum crc32...cbd6e8ef
compress...
compress used time: 12.339 second. size: 24.669 mbs.
uncompress...
uncompress used time: 12.396 second. size: 26.714 mbs.
passed [OK]
end.
Definition in file string.h.