cbor.rs (2524B)
1 /// A [`u64`]. 2 const UINT: u8 = 0b000_00000; 3 /// A negative integer whose value _m ∈ [-2^64 - 1, -1]_ is represented as _|m| - 1_. 4 const NEG: u8 = 0b001_00000; 5 /// A byte string. 6 pub(super) const BYTES: u8 = 0b010_00000; 7 /// A text string. 8 const TEXT: u8 = 0b011_00000; 9 /// A map of key-value pairs. 10 const MAP: u8 = 0b101_00000; 11 /// Simple values. 12 const SIMPLE: u8 = 0b111_00000; 13 /// [`UINT`] value `1`. 14 pub(super) const ONE: u8 = UINT | 1; 15 /// [`UINT`] value `2`. 16 pub(super) const TWO: u8 = UINT | 2; 17 /// [`UINT`] value `3`. 18 pub(super) const THREE: u8 = UINT | 3; 19 /// [`UINT`] value `6`. 20 pub(super) const SIX: u8 = UINT | 6; 21 /// [`NEG`] value `-1`. 22 pub(super) const NEG_ONE: u8 = NEG; 23 /// [`NEG`] value `-2`. 24 pub(super) const NEG_TWO: u8 = NEG | 1; 25 /// [`NEG`] value `-3`. 26 pub(super) const NEG_THREE: u8 = NEG | 2; 27 /// [`NEG`] value `-7`. 28 pub(super) const NEG_SEVEN: u8 = NEG | 6; 29 /// [`NEG`] value `-8`. 30 pub(super) const NEG_EIGHT: u8 = NEG | 7; 31 /// [`NEG`] value less than `-24` but greater than `-257`. 32 pub(super) const NEG_INFO_24: u8 = NEG | 24; 33 /// [`NEG`] value less than `-256` but greater than `-65537`. 34 pub(super) const NEG_INFO_25: u8 = NEG | 25; 35 /// [`BYTES`] length greater than `23` but less than `256`. 36 pub(super) const BYTES_INFO_24: u8 = BYTES | 24; 37 /// [`BYTES`] length greater than `255` but less than `65536`. 38 pub(super) const BYTES_INFO_25: u8 = BYTES | 25; 39 /// [`TEXT`] length `3`. 40 pub(super) const TEXT_3: u8 = TEXT | 3; 41 /// [`TEXT`] length `4`. 42 pub(super) const TEXT_4: u8 = TEXT | 4; 43 /// [`TEXT`] length `6`. 44 pub(super) const TEXT_6: u8 = TEXT | 6; 45 /// [`TEXT`] length `7`. 46 pub(super) const TEXT_7: u8 = TEXT | 7; 47 /// [`TEXT`] length `8`. 48 pub(super) const TEXT_8: u8 = TEXT | 8; 49 /// [`TEXT`] length `11`. 50 pub(super) const TEXT_11: u8 = TEXT | 11; 51 /// [`TEXT`] length `12`. 52 pub(super) const TEXT_12: u8 = TEXT | 12; 53 /// [`MAP`] length `0`. 54 pub(super) const MAP_0: u8 = MAP; 55 /// [`MAP`] length `1`. 56 pub(super) const MAP_1: u8 = MAP | 1; 57 /// [`MAP`] length `2`. 58 pub(super) const MAP_2: u8 = MAP | 2; 59 /// [`MAP`] length `3`. 60 pub(super) const MAP_3: u8 = MAP | 3; 61 /// [`MAP`] length `4`. 62 pub(super) const MAP_4: u8 = MAP | 4; 63 /// [`MAP`] length `5`. 64 pub(super) const MAP_5: u8 = MAP | 5; 65 /// [`SIMPLE`] value `false`. 66 pub(super) const SIMPLE_FALSE: u8 = SIMPLE | 20; 67 /// [`SIMPLE`] value `true`. 68 pub(super) const SIMPLE_TRUE: u8 = SIMPLE | 21; 69 /// [`TEXT`] value hmac-secret. 70 pub(super) const HMAC_SECRET: [u8; 12] = [ 71 TEXT_11, b'h', b'm', b'a', b'c', b'-', b's', b'e', b'c', b'r', b'e', b't', 72 ];