Skip to main content

CBORPrimitives

CBORPrimitives​

Parses out CBOR primitive values `CBORDataStructures.sol` handles hashes and arrays.

parseInteger​

function parseInteger(uint256 cursor, uint256 shortCount) internal view returns (uint256 dataStart, uint256 dataEnd)

Parses a CBOR-encoded integer and determines where data start/ends.

NameTypeDescription
cursoruint256position where integer starts (in bytes)
shortCountuint256short data identifier included in field info
NameTypeDescription
dataStartuint256byte position where data starts
dataEnduint256byte position where data ends

parseString​

function parseString(bytes encoding, uint256 cursor, uint256 shortCount) internal view returns (uint256 dataStart, uint256 dataEnd)

Parses a CBOR-encoded strings and determines where data start/ends.

NameTypeDescription
encodingbytesthe dynamic bytes array to scan
cursoruint256position where integer starts (in bytes)
shortCountuint256short data identifier included in field info
NameTypeDescription
dataStartuint256byte position where data starts
dataEnduint256byte position where data ends

parseSemantic​

function parseSemantic(bytes encoding, uint256 cursor, uint256 shortCount) internal view returns (uint256 dataStart, uint256 dataEnd)

Parses a CBOR-encoded tag type (big nums).

NameTypeDescription
encodingbytesthe dynamic bytes array to scan
cursoruint256position where integer starts (in bytes)
shortCountuint256short data identifier included in field info
NameTypeDescription
dataStartuint256byte position where data starts
dataEnduint256byte position where data ends

parseSpecial​

function parseSpecial(uint256 cursor, uint256 shortCount) internal view returns (uint256 dataStart, uint256 dataEnd)

Parses a CBOR-encoded special type.

NameTypeDescription
cursoruint256position where integer starts (in bytes)
shortCountuint256short data identifier included in field info
NameTypeDescription
dataStartuint256byte position where data starts
dataEnduint256byte position where data ends

CBORPrimitives​

Parses out CBOR primitive values `CBORDataStructures.sol` handles hashes and arrays.

parseInteger​

function parseInteger(uint256 cursor, uint256 shortCount) internal view returns (uint256 dataStart, uint256 dataEnd)

Parses a CBOR-encoded integer and determines where data start/ends.

NameTypeDescription
cursoruint256position where integer starts (in bytes)
shortCountuint256short data identifier included in field info
NameTypeDescription
dataStartuint256byte position where data starts
dataEnduint256byte position where data ends

parseString​

function parseString(bytes encoding, uint256 cursor, uint256 shortCount) internal view returns (uint256 dataStart, uint256 dataEnd)

Parses a CBOR-encoded strings and determines where data start/ends.

NameTypeDescription
encodingbytesthe dynamic bytes array to scan
cursoruint256position where integer starts (in bytes)
shortCountuint256short data identifier included in field info
NameTypeDescription
dataStartuint256byte position where data starts
dataEnduint256byte position where data ends

parseSemantic​

function parseSemantic(bytes encoding, uint256 cursor, uint256 shortCount) internal view returns (uint256 dataStart, uint256 dataEnd)

Parses a CBOR-encoded tag type (big nums).

NameTypeDescription
encodingbytesthe dynamic bytes array to scan
cursoruint256position where integer starts (in bytes)
shortCountuint256short data identifier included in field info
NameTypeDescription
dataStartuint256byte position where data starts
dataEnduint256byte position where data ends

parseSpecial​

function parseSpecial(uint256 cursor, uint256 shortCount) internal view returns (uint256 dataStart, uint256 dataEnd)

Parses a CBOR-encoded special type.

NameTypeDescription
cursoruint256position where integer starts (in bytes)
shortCountuint256short data identifier included in field info
NameTypeDescription
dataStartuint256byte position where data starts
dataEnduint256byte position where data ends