File: const.go

package info (click to toggle)
golang-github-aws-smithy-go 1.20.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 3,116 kB
  • sloc: java: 19,678; xml: 166; sh: 131; makefile: 70
file content (41 lines) | stat: -rw-r--r-- 741 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
package cbor

// major type in LSB position
type majorType byte

const (
	majorTypeUint majorType = iota
	majorTypeNegInt
	majorTypeSlice
	majorTypeString
	majorTypeList
	majorTypeMap
	majorTypeTag
	majorType7
)

// masks for major/minor component in encoded head
const (
	maskMajor = 0b111 << 5
	maskMinor = 0b11111
)

// minor value encodings to represent arg bit length (and indefinite)
const (
	minorArg1       = 24
	minorArg2       = 25
	minorArg4       = 26
	minorArg8       = 27
	minorIndefinite = 31
)

// minor sentinels for everything in major 7
const (
	major7False     = 20
	major7True      = 21
	major7Nil       = 22
	major7Undefined = 23
	major7Float16   = minorArg2
	major7Float32   = minorArg4
	major7Float64   = minorArg8
)