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.
Name | Type | Description |
---|---|---|
cursor | uint256 | position where integer starts (in bytes) |
shortCount | uint256 | short data identifier included in field info |
Name | Type | Description |
---|---|---|
dataStart | uint256 | byte position where data starts |
dataEnd | uint256 | byte 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.
Name | Type | Description |
---|---|---|
encoding | bytes | the dynamic bytes array to scan |
cursor | uint256 | position where integer starts (in bytes) |
shortCount | uint256 | short data identifier included in field info |
Name | Type | Description |
---|---|---|
dataStart | uint256 | byte position where data starts |
dataEnd | uint256 | byte 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).
Name | Type | Description |
---|---|---|
encoding | bytes | the dynamic bytes array to scan |
cursor | uint256 | position where integer starts (in bytes) |
shortCount | uint256 | short data identifier included in field info |
Name | Type | Description |
---|---|---|
dataStart | uint256 | byte position where data starts |
dataEnd | uint256 | byte position where data ends |
parseSpecial
function parseSpecial(uint256 cursor, uint256 shortCount) internal view returns (uint256 dataStart, uint256 dataEnd)
Parses a CBOR-encoded special type.
Name | Type | Description |
---|---|---|
cursor | uint256 | position where integer starts (in bytes) |
shortCount | uint256 | short data identifier included in field info |
Name | Type | Description |
---|---|---|
dataStart | uint256 | byte position where data starts |
dataEnd | uint256 | byte 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.
Name | Type | Description |
---|---|---|
cursor | uint256 | position where integer starts (in bytes) |
shortCount | uint256 | short data identifier included in field info |
Name | Type | Description |
---|---|---|
dataStart | uint256 | byte position where data starts |
dataEnd | uint256 | byte 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.
Name | Type | Description |
---|---|---|
encoding | bytes | the dynamic bytes array to scan |
cursor | uint256 | position where integer starts (in bytes) |
shortCount | uint256 | short data identifier included in field info |
Name | Type | Description |
---|---|---|
dataStart | uint256 | byte position where data starts |
dataEnd | uint256 | byte 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).
Name | Type | Description |
---|---|---|
encoding | bytes | the dynamic bytes array to scan |
cursor | uint256 | position where integer starts (in bytes) |
shortCount | uint256 | short data identifier included in field info |
Name | Type | Description |
---|---|---|
dataStart | uint256 | byte position where data starts |
dataEnd | uint256 | byte position where data ends |
parseSpecial
function parseSpecial(uint256 cursor, uint256 shortCount) internal view returns (uint256 dataStart, uint256 dataEnd)
Parses a CBOR-encoded special type.
Name | Type | Description |
---|---|---|
cursor | uint256 | position where integer starts (in bytes) |
shortCount | uint256 | short data identifier included in field info |
Name | Type | Description |
---|---|---|
dataStart | uint256 | byte position where data starts |
dataEnd | uint256 | byte position where data ends |