tagion_hibon_add_bigint

Add big number to hibon

extern (C)
int
tagion_hibon_add_bigint
(,
const char* key
,
const size_t key_len
,
const uint8_t* bigint_buf
,
const size_t bigint_buf_len
)

Parameters

instance const(HiBONT*)

pointer to the instance

key char*

pointer to the key

key_len size_t

length of the key

bigint_buf uint8_t*

big int buffer as serialized leb128

bigint_buf_len size_t

length of the buffer

Return Value

Type: int

ErrorCode

Examples

HiBONT h;
int rt = tagion_hibon_create(&h);
assert(rt == ErrorCode.none, "could not create hibon");
string key = "some_key";
auto big_number = BigNumber(321);
auto big_number_data = big_number.serialize;

rt = tagion_hibon_add_bigint(&h, &key[0], key.length, &big_number_data[0], big_number_data.length);
assert(rt == ErrorCode.none);
HiBON result = cast(HiBON) h.hibon;
assert(result[key].get!(BigNumber) == big_number);