-
Notifications
You must be signed in to change notification settings - Fork 0
/
const.go
50 lines (46 loc) · 1.05 KB
/
const.go
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
42
43
44
45
46
47
48
49
50
package scale
const (
// MoveBit for the highest six bit is has special means, in order to get origin num, must move right 2bit
// also encode a number must move left 2bit
MoveBit = 2
// SingleMode the higher six bit is LE for value, which is 0 to 63
SingleMode = 0b00
MaxSingle = 63
// DoubleMode the higher six bit and next byte is LE for value, which is 64 to 1<<14 - 1
DoubleMode = 0b01
MaxDouble = 1<<14 - 1
// FourByteMode the higher six bit and next three bytes is LE for value, which is 1<<14 -1 to 1<<30-1
FourByteMode = 0b10
MaxFour = 1<<30 - 1
// BigIntMode the highest six bit represent the bytes num in the next, which less than 4.
// then, the next bytes contain the LE for value. the highest one can not be 0, which is
// 1<<30-1 to 1<<536-1
BigIntMode = 0b11
)
type PrimitiveType int
const (
None PrimitiveType = iota
String
Struct
Uint8
Int8
CompactUInt8
Uint16
Int16
CompactUint16
Uint32
Int32
CompactUint32
Uint64
Int64
CompactUint64
BigInt
BigUint
CompactBigInt
Bool
Vec
Primitive
Array
Tuple
Enum
)