TupleTypes

Namespace: SnowBank.Data.Tuples.Binary · class

Constants for the various tuple value types

Methods

DecodeSegmentType

static TupleSegmentType DecodeSegmentType(Slice segment)

Returns the type of tuple segment, from its header

static TupleSegmentType DecodeSegmentType(ReadOnlySpan<byte> segment)

Return the type of tuple segment, from its header

Fields

Bytes

const byte Bytes

ASCII String (01 ... 00)

Directory

const byte Directory

Standard prefix of the Directory Layer

This is not a part of the tuple encoding itself, but helps the tuple decoder pretty-print tuples that would otherwise be unparsable.

Double

const byte Double

Double precision decimals (64-bit, Big-Endian)

21 xx xx xx xx xx xx xx xx

EmbeddedTuple

const byte EmbeddedTuple

Nested tuple (05 ... 00)

EndOfTuple

const byte EndOfTuple

Marks the end of the tuple encoding (extension)

This type indicates that the following bytes are not part of the tuple and are handled using a custom key encoding.

This is an extension of the original Tuple specification, and may not be supported by all bindings.

Escape

const byte Escape

Standard prefix of the System keys, or frequent suffix with key ranges

False

const byte False

False Value

26

IntNeg1

const byte IntNeg1

Negative Integer (1 byte, Big-Endian, One's Complement)

13 xx

IntNeg2

const byte IntNeg2

Negative Integer (2 bytes, Big-Endian, One's Complement)

12 xx xx

IntNeg3

const byte IntNeg3

Negative Integer (3 bytes, Big-Endian, One's Complement)

11 xx xx xx

IntNeg4

const byte IntNeg4

Negative Integer (4 bytes, Big-Endian, One's Complement)

10 xx xx xx xx

IntNeg5

const byte IntNeg5

Negative Integer (5 bytes, Big-Endian, One's Complement)

0F xx xx xx xx xx

IntNeg6

const byte IntNeg6

Negative Integer (6 bytes, Big-Endian, One's Complement)

0E xx xx xx xx xx xx

IntNeg7

const byte IntNeg7

Negative Integer (7 bytes, Big-Endian, One's Complement)

0E xx xx xx xx xx xx xx

IntNeg8

const byte IntNeg8

Negative Integer (8 bytes, Big-Endian, One's Complement)

0C xx xx xx xx xx xx xx xx

IntPos1

const byte IntPos1

Positive Integer (1 byte, Big-Endian)

15 xx

IntPos2

const byte IntPos2

Positive Integer (2 bytes, Big-Endian)

16 xx xx

IntPos3

const byte IntPos3

Positive Integer (3 bytes, Big-Endian)

17 xx xx xx

IntPos4

const byte IntPos4

Positive Integer (4 bytes, Big-Endian)

18 xx xx xx xx

IntPos5

const byte IntPos5

Positive Integer (5 bytes, Big-Endian)

19 xx xx xx xx xx

IntPos6

const byte IntPos6

Positive Integer (6 bytes, Big-Endian)

1A xx xx xx xx xx xx

IntPos7

const byte IntPos7

Positive Integer (7 bytes, Big-Endian)

1B xx xx xx xx xx xx xx

IntPos8

const byte IntPos8

Positive Integer (8 bytes, Big-Endian)

1C xx xx xx xx xx xx xx xx

IntZero

const byte IntZero

Zero

LegacyTrue

const byte LegacyTrue

True Value [OBSOLETE]

Deprecated and should not be used anymore

LegacyTupleEnd

const byte LegacyTupleEnd

Nested tuple end [OBSOLETE]

Deprecated and should not be used anymore

LegacyTupleStart

const byte LegacyTupleStart

Nested tuple start [OBSOLETE]

Deprecated and should not be used anymore

NegativeBigInteger

const byte NegativeBigInteger

Negative arbitrary-precision integer (8-bit count, 9 to 255 bytes)

0B ## xx xx xx ...

Nil

const byte Nil

Null/Empty/Void

PositiveBigInteger

const byte PositiveBigInteger

Positive arbitrary-precision integer (8-bit count, 9 to 255 bytes)

1D ## xx xx xx ...

Quadruple

const byte Quadruple

Quadruple precision decimals (128-bit, Big-Endian)

23 xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx

Single

const byte Single

Single precision decimals (32-bit, Big-Endian)

20 xx xx xx xx

Triple

const byte Triple

Triple precision decimals (80-bit, Big-Endian)

22 xx xx xx xx xx xx xx xx xx xx

True

const byte True

True Value

27

UserType0

const byte UserType0

Reserved Type 0 (application specific)

40 ?? ...

UserType1

const byte UserType1

Reserved Type 1 (application specific)

41 ?? ...

UserType2

const byte UserType2

Reserved Type 2 (application specific)

42 ?? ...

UserType3

const byte UserType3

Reserved Type 3 (application specific)

43 ?? ...

UserType4

const byte UserType4

Reserved Type 4 (application specific)

44 ?? ...

UserType5

const byte UserType5

Reserved Type 5 (application specific)

45 ?? ...

UserType6

const byte UserType6

Reserved Type 6 (application specific)

46 ?? ...

UserType7

const byte UserType7

Reserved Type 7 (application specific)

47 ?? ...

UserType8

const byte UserType8

Reserved Type 8 (application specific)

48 ?? ...

UserType9

const byte UserType9

Reserved Type 9 (application specific)

49 ?? ...

UserTypeA

const byte UserTypeA

Reserved Type 10 (application specific)

4A ?? ...

UserTypeB

const byte UserTypeB

Reserved Type 11 (application specific)

4B ?? ...

UserTypeC

const byte UserTypeC

Reserved Type 12 (application specific)

4C ?? ...

UserTypeD

const byte UserTypeD

Reserved Type 13 (application specific)

4D ?? ...

UserTypeE

const byte UserTypeE

Reserved Type 14 (application specific)

4E ?? ...

UserTypeF

const byte UserTypeF

Reserved Type 15 (application specific)

4F ?? ...

Utf8

const byte Utf8

UTF-8 String (02 ... 00)

Uuid128

const byte Uuid128

RFC4122 UUID (128 bits)

30 xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx

Uuid64

const byte Uuid64

UUID (64 bits)

31 xx xx xx xx xx xx xx xx

Uuid80

const byte Uuid80

UUID (80 bits) / VersionStamp

32 xx xx xx xx xx xx xx xx xx xx

Uuid96

const byte Uuid96

UUID (96 bits) / VersionStamp

33 xx xx xx xx xx xx xx xx xx xx xx xx

VarBytes1

const byte VarBytes1

Length-Prefixed Byte String (up to 255 bytes)

An 8-bit integer representing the length, followed by the given number of bytes

Well suited for storing hashes, or similar binary blobs that may contain a lot of 0x00 bytes, without having to escape them.

This is an extension of the original Tuple specification, and may not be supported by all bindings.

VarBytes2

const byte VarBytes2

Length-Prefixed Byte String (from 256 to 65535 bytes)

A 16-bit big-endian integer representing the length, followed by the given number of bytes

Well suited for storing hashes, or similar binary blobs that may contain a lot of 0x00 bytes, without having to escape them.

Lengths of 255 or less should use VarBytes1 instead.

This is an extension of the original Tuple specification, and may not be supported by all bindings.