Add the Binary data type and corresponding helper functions to Asterix.
The binary data type is implemented as a bytearray. Its storage format
follows the String type which has 2 bytes for length and then store the
bytes contents.
Binary data will take hex("") or base64("") as the constructor method to
passing a hex string or base64 string into Asterix. For output we use
hex("") format.
The parse-[hex|base64](string) function will parse the corresponding hex
or base64 string to binary type. The print-[hex|base64](binary)
functions will print the binary to hex or base64 STRING format.
The sub-binary(binary, offset, [length]) function works the same as
substring(string, offset, [length])
The find-binary(srcbinary, targetbinary, [start-offset]) will find the
position of the targetbinary in the srcbinary.
Change-Id: I5ecf0cc115c44070fb5c1fc5b0ec12a95d4243a4
Reviewed-on: http://fulliautomatix.ics.uci.edu:8443/175
Tested-by: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Reviewed-by: Yingyi Bu <buyingyi@gmail.com>
diff --git a/asterix-app/data/adm-load/binary_type.adm b/asterix-app/data/adm-load/binary_type.adm
new file mode 100644
index 0000000..2f79dff
--- /dev/null
+++ b/asterix-app/data/adm-load/binary_type.adm
@@ -0,0 +1 @@
+{ "ba": hex("ABCDEF0123456789"), "bb": hex("ABCDEF0123456789"), "bc": hex("0A0B0C0D0E0F"), "bd": hex("01020304050607080900"), "bx": base64("q83vASNFZ4k="), "by": hex("ABCDEF0123456789"), "bz": base64("CgsMDQ4P"), "bw": base64("AQIDBAUGBwgJAA==") }
diff --git a/asterix-app/data/adm-load/usermd5.adm b/asterix-app/data/adm-load/usermd5.adm
new file mode 100644
index 0000000..09b6a69
--- /dev/null
+++ b/asterix-app/data/adm-load/usermd5.adm
@@ -0,0 +1,25 @@
+{ "id":1, "name":"Ronny Feeney", "md5": hex("34126a9a8c6e8ea118216c7b1048dda0") }
+{ "id":2, "name":"Adolph Abraham", "md5": hex("46b199c4c7fa55085eea0facd6a3c3b8") }
+{ "id":3, "name":"Odelia Orosco", "md5": hex("4a0450fe08c5421bb342f36e26c67a61") }
+{ "id":4, "name":"Jasper Villarreal", "md5": hex("173d7751e6fa210b9494503247045c9e") }
+{ "id":5, "name":"Florencio Forbes", "md5": hex("96892c30078964b56082fd00573673e4") }
+{ "id":6, "name":"Violette Maes", "md5": hex("f998bd34cfbe9b742c62e0aa9d06c977") }
+{ "id":7, "name":"Jenae Marble", "md5": hex("204d482bc66e368b72a85e0691804626") }
+{ "id":8, "name":"Chase Harness", "md5": hex("3bde012cc94ce1bdb44ade4e38902072") }
+{ "id":9, "name":"Nia Luster", "md5": hex("bb6842ce561ac90e75b033821b34f2bd") }
+{ "id":10, "name":"Joye Langdon", "md5": hex("881b39c29a960774f53d31762684abcc") }
+{ "id":11, "name":"Tennie Mcfall", "md5": hex("68f4f0355cde1b6c1746755be9559030") }
+{ "id":12, "name":"Tennie Margarete Hutcherson", "md5": hex("885f2930e80ae8e985beb9d2afc60e66") }
+{ "id":13, "name":"Alexa Hess", "md5": hex("da3a3aa357f469c2eef30e636a67366a") }
+{ "id":14, "name":"Afton Smiley", "md5": hex("aa24b12619d1723817e0aae507dc5d16") }
+{ "id":15, "name":"Tamela Wilkes", "md5": hex("0bdfecee101f739d708169a3d7bf692d") }
+{ "id":16, "name":"Thaddeus Hightower", "md5": hex("1c5631b1e0023366dbaac5cab125a507") }
+{ "id":17, "name":"Carmelita Jarvis", "md5": hex("b8862e8f77173a39b55a36ba0f0d44c6") }
+{ "id":18, "name":"Vanetta Chacon", "md5": hex("b0d3e7d02ef3bee600fdbd2b688f9cf5") }
+{ "id":19, "name":"Alline Giron", "md5": hex("6c718cb3708992f7a482619348011abf") }
+{ "id":20, "name":"Louis Roche", "md5": hex("d64f30701a822ebe9f8a25b66c264e88") }
+{ "id":21, "name":"Rachal Chavis", "md5": hex("b412f8294bddaf083d86d2b650bcc75f") }
+{ "id":22, "name":"Cedrick Herman", "md5": hex("23c34ac38626e0b0f3717c7347dd2ec5") }
+{ "id":23, "name":"Latrisha Walling", "md5": hex("57af6780c9b51bd783412ea4520dac2a") }
+{ "id":24, "name":"Neda Earle", "md5": hex("ca312d57fd3365b10448f5008ae2f555") }
+{ "id":25, "name":"Tamekia Connelly", "md5": hex("6b5fd221ef1fb9d41d105f7b6206494b") }
diff --git a/asterix-app/data/adm-load/usermd5copy.adm b/asterix-app/data/adm-load/usermd5copy.adm
new file mode 100644
index 0000000..c981fed
--- /dev/null
+++ b/asterix-app/data/adm-load/usermd5copy.adm
@@ -0,0 +1,20 @@
+{ "id":1, "name": "Ronny Feeney", "md5": base64("NBJqmoxujqEYIWx7EEjdoA==") }
+{ "id":2, "name": "Adolph Abraham", "md5": base64("RrGZxMf6VQhe6g+s1qPDuA==") }
+{ "id":3, "name": "Odelia Orosco", "md5": base64("SgRQ/gjFQhuzQvNuJsZ6YQ==") }
+{ "id":4, "name": "Jasper Villarreal", "md5": base64("Fz13Ueb6IQuUlFAyRwRcng==") }
+{ "id":5, "name": "Florencio Forbes", "md5": base64("loksMAeJZLVggv0AVzZz5A==") }
+{ "id":6, "name": "Violette Maes", "md5": base64("+Zi9NM++m3QsYuCqnQbJdw==") }
+{ "id":7, "name": "Jenae Marble", "md5": base64("IE1IK8ZuNotyqF4GkYBGJg==") }
+{ "id":8, "name": "Chase Harness", "md5": base64("O94BLMlM4b20St5OOJAgcg==") }
+{ "id":9, "name": "Nia Luster", "md5": base64("u2hCzlYayQ51sDOCGzTyvQ==") }
+{ "id":10, "name": "Joye Langdon", "md5": base64("iBs5wpqWB3T1PTF2JoSrzA==") }
+{ "id":30, "name": "Trang Fortenberry", "md5": hex("0a6ebf67522bed580f3e4779dc60ef29") }
+{ "id":31, "name": "Ria Ellsworth", "md5": hex("3af7c2ac759fd3f3c89dcccdc5f4b5df") }
+{ "id":32, "name": "Virgina Baine", "md5": hex("c63c87c07ce7ccf9aa1d6714be537c64") }
+{ "id":33, "name": "Maryam Runyan", "md5": hex("fde31a65de79ac40d986e4decd4de52d") }
+{ "id":34, "name": "Harland Slone", "md5": hex("9c779a36c8a0dd83d1cbd6811a36e837") }
+{ "id":35, "name": "Pearle Whitley", "md5": hex("d5f7b64f8e1ea21f888a7213273f437c") }
+{ "id":36, "name": "Sulema Gillis", "md5": hex("5c666e65939e007777dd373d5f54ae1f") }
+{ "id":37, "name": "Graig Brubaker", "md5": hex("e405cb11cca4371f543ac3d0fbbe6d7b") }
+{ "id":38, "name": "Damaris Durden", "md5": hex("3fb470ec2894a7205c5446978927459a") }
+{ "id":39, "name": "Eldora Leighton", "md5": hex("911cdf4749f6bb6057c096ce12e308c3") }
diff --git a/asterix-app/data/nontagged/allData.json b/asterix-app/data/nontagged/allData.json
index 5f7bf3b..06c786f 100644
--- a/asterix-app/data/nontagged/allData.json
+++ b/asterix-app/data/nontagged/allData.json
@@ -1,2 +1,17 @@
-{ "id": 10, "name": string("Nancy"), "age": 32.5f, "salary": 12.000 ,"married": boolean("true"), "interests": {{"reading", "writing"}}, "children": ["Brad", "Scott"], "address": { "number": 8389, "street": "Hill St.", "city": "Mountain View" }, "dob": date("-2011-01-27"), "time": time("12:20:30Z"), "datetime": datetime("-1951-12-27T12:20:30"), "duration": duration("P10Y11M12DT10H50M30S"), "location2d": point("41.00,44.00"), "location3d": point3d("44.00,13.00,41.00"), "line" : line("10.1,11.1 10.2,11.2"), "polygon" : polygon("1.2,1.3 2.1,2.5 3.5,3.6 4.6,4.8"), "circle" : circle("10.1,11.1 10.2") }
-
+{ "id": 10,
+"name": string("Nancy"),
+"age": 32.5f,
+"salary": 12.000 ,"married": boolean("true"),
+"interests": {{"reading","writing"}},
+"children": ["Brad","Scott"],
+ "address": { "number": 8389, "street": "Hill St.", "city": "Mountain View" },
+"dob": date("-2011-01-27"),
+"time": time("12:20:30Z"),
+"datetime": datetime("-1951-12-27T12:20:30"),
+ "duration": duration("P10Y11M12DT10H50M30S"),
+ "location2d": point("41.00,44.00"),
+ "location3d": point3d("44.00,13.00,41.00"),
+"line" : line("10.1,11.1 10.2,11.2"),
+"polygon" : polygon("1.2,1.3 2.1,2.5 3.5,3.6 4.6,4.8"),
+"circle" : circle("10.1,11.1 10.2"),
+"binary" : hex("ABCDEF0123456789") }