1byteで表現されるdata item headerの先頭3bit. 8bitあるうちの先頭3bitにcategory typeを持ってきたいのでmajor typeを5bitシフトさせる.
encodeしたCBORのadditional informationが0-23になるように変換する. major type1としたとき取りうるadditional informationに対応する数は-24まで. (ex) 001 00000 ~ 001 10111
-1 ~ -24の数
Buffer
encodeしたCBORのadditional informationが24になるように変換する. major type1としたとき取りうるadditional informationに対応する数は-25 ~ -255まで. 先頭のbyteにデータ構造, 続くbyteにデータがuint8_tで書き込まれる。(合計で2byte) (ex) 001 11000 xxxxxxxx
-25 ~ -255の数
Buffer
encodeしたCBORのadditional informationが25になるように変換する. major type1としたとき取りうるadditional informationに対応する数は-256 ~ -65535まで. 先頭のbyteにデータ構造, 続く2byteにデータがuint16_tで書き込まれる。(合計で3byte)
encodeしたCBORのadditional informationが26になるように変換する. major type1としたとき取りうるadditional informationに対応する数は-65536 ~ -4294967295 まで. 先頭のbyteにデータ構造, 続く4byteにデータがuint32_tで書き込まれる。(合計で5byte)
encodeしたCBORのadditional informationが27になるように変換する. major type1としたとき取りうるadditional informationに対応する数は-4294967295 ~ -9007199254740991. 先頭のbyteにデータ構造, 続く8byteにデータがuint64_tで書き込まれる。(合計で9byte)
負の数を正の数に変換して-1をする関数。 integer. The encoding follows the rules for unsigned integers (major type 0), except that the value is then -1 minus the encoded unsigned integer.
変換したい数
Generated using TypeDoc
負数のエンコード関数をまとめたクラス. Major Typeは1