The Rust Implementation of Stellar Notation, a data encoding library.
```
stellar-notation = "0.9.9"
```
```
use stellarnotation::{ bytedecode, byteencode, valuedecode, value_encode }
```
Encoding and Decoding Values into Hex String is supported for u128 and bytes.
```
let u128str: String = valueencode::u128(1);
let u128num: u128 = valuedecode::as128(u128str);
```
```
let bytes: Vec
let bytestr: String = valueencode::bytes(bytes);
let decodedbytestr: Vec
```
An Object is a Key-Value Tuple. Keys and Values are UTF-8 Strings.
```
let key: String = String::from("key_1");
let value: String = String::from("value_1");
let object: Vec
```
| Value | Size(bytes) | |---|---| | Key Length | 1 | | Value Length | 8 | | Key Data | max 255 | | Value Data | max ~18.45 exa |
Value data is also limited by the system file size limit.
Reconverts bytes into a Two String Tuple.
```
let keyvalue: (String, String) = bytedecode::object(serialized);
```
Converts a group of Two String Tuples into bytes.
```
let objects: Vec<(String, String)> = vec![ object1, object2, object3 ]
let group: Vec
```
| Group | | --- | | Obj1, Obj2 ... Obj(n) |
Reconverts bytes into a group of two string tuples.
```
let keyvaluegroup: Vec<(String, String)> = byte_decode::group(group);
```