Bitcoin ABC 0.30.5
P2P Digital Currency
|
#include <crypto/common.h>
#include <serialize.h>
#include <tinyformat.h>
#include <cstdint>
#include <ios>
Go to the source code of this file.
Functions | |
template<typename Stream > | |
void | WriteIntcode (Stream &os, uint64_t value) |
Write a 64-bit integer in intcode encoding: More... | |
template<typename Stream > | |
uint64_t | ReadIntcode (Stream &is) |
Read a 64-bit integer as intcode, see WriteIntcode. More... | |
Variables | |
const uint64_t | VALID_RANGE [] |
uint64_t ReadIntcode | ( | Stream & | is | ) |
Read a 64-bit integer as intcode, see WriteIntcode.
Specification & rationale can be found here: https://ecashbuilders.notion.site/eCash-Mitra-Integer-Encoding-Spec-2ff596494dcf4d12b75c763464df39de?pvs=4
Definition at line 84 of file serialize_intcode.h.
void WriteIntcode | ( | Stream & | os, |
uint64_t | value | ||
) |
Write a 64-bit integer in intcode encoding:
Similar to UTF-8, except data bytes don't have a 10xx'xxxx prefix
Specification & rationale can be found here: https://ecashbuilders.notion.site/eCash-Mitra-Integer-Encoding-Spec-2ff596494dcf4d12b75c763464df39de?pvs=4
Examples: 0x0000'0000'0000'007f (7) -> "7f" 0x0000'0000'0000'3fff (14) -> "bfff" 0x0000'0000'001f'ffff (21) -> "dfffff" 0x0000'0000'0fff'ffff (28) -> "efffffff" 0x0000'0007'ffff'ffff (35) -> "f7ffffffff" 0x0000'03ff'ffff'ffff (42) -> "fbffffffffff" 0x0001'ffff'ffff'ffff (49) -> "fdffffffffffff" 0x00ff'ffff'ffff'ffff (56) -> "feffffffffffffff" 0xffff'ffff'ffff'ffff (63) -> "ffffffffffffffffff"
Definition at line 46 of file serialize_intcode.h.
const uint64_t VALID_RANGE[] |
Definition at line 15 of file serialize_intcode.h.