commit | 9d3c4a95ee1f8a20184e0d42acc64cb0f40a524f | [log] [tgz] |
---|---|---|
author | JavierJia <jianfeng.jia@gmail.com> | Thu Nov 20 13:09:58 2014 -0800 |
committer | Ian Maxon <imaxon@uci.edu> | Fri Nov 21 11:13:59 2014 -0800 |
tree | 594019f1db95978d71f383a12ea2a5d14157a110 | |
parent | f4e13fbe66312f8d7bbedb712735a874bd64f573 [diff] |
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>