forked from hildjj/node-cbor
-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathconstants.js
73 lines (64 loc) · 1.07 KB
/
constants.js
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
'use strict'
const Bignumber = require('bignumber.js')
exports.MT = {
POS_INT: 0,
NEG_INT: 1,
BYTE_STRING: 2,
UTF8_STRING: 3,
ARRAY: 4,
MAP: 5,
TAG: 6,
SIMPLE_FLOAT: 7
}
exports.TAG = {
DATE_STRING: 0,
DATE_EPOCH: 1,
POS_BIGINT: 2,
NEG_BIGINT: 3,
DECIMAL_FRAC: 4,
BIGFLOAT: 5,
BASE64URL_EXPECTED: 21,
BASE64_EXPECTED: 22,
BASE16_EXPECTED: 23,
CBOR: 24,
URI: 32,
BASE64URL: 33,
BASE64: 34,
REGEXP: 35,
MIME: 36
}
exports.NUMBYTES = {
ZERO: 0,
ONE: 24,
TWO: 25,
FOUR: 26,
EIGHT: 27,
INDEFINITE: 31
}
exports.SIMPLE = {
FALSE: 20,
TRUE: 21,
NULL: 22,
UNDEFINED: 23
}
exports.SYMS = {
NULL: Symbol('null'),
UNDEFINED: Symbol('undef'),
PARENT: Symbol('parent'),
BREAK: Symbol('break'),
STREAM: Symbol('stream')
}
exports.SHIFT32 = Math.pow(2, 32)
exports.SHIFT16 = Math.pow(2, 16)
exports.MAX_SAFE_HIGH = 0x1fffff
exports.NEG_ONE = new Bignumber(-1)
exports.TEN = new Bignumber(10)
exports.TWO = new Bignumber(2)
exports.PARENT = {
ARRAY: 0,
OBJECT: 1,
MAP: 2,
TAG: 3,
BYTE_STRING: 4,
UTF8_STRING: 5
}