source: trip-planner-front/node_modules/@webassemblyjs/leb128/lib/index.js@ fa375fe

Last change on this file since fa375fe was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 1.5 KB
Line 
1"use strict";
2
3Object.defineProperty(exports, "__esModule", {
4 value: true
5});
6exports.decodeInt64 = decodeInt64;
7exports.decodeUInt64 = decodeUInt64;
8exports.decodeInt32 = decodeInt32;
9exports.decodeUInt32 = decodeUInt32;
10exports.encodeU32 = encodeU32;
11exports.encodeI32 = encodeI32;
12exports.encodeI64 = encodeI64;
13exports.MAX_NUMBER_OF_BYTE_U64 = exports.MAX_NUMBER_OF_BYTE_U32 = void 0;
14
15var _leb = _interopRequireDefault(require("./leb"));
16
17function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
18
19/**
20 * According to https://webassembly.github.io/spec/core/binary/values.html#binary-int
21 * max = ceil(32/7)
22 */
23var MAX_NUMBER_OF_BYTE_U32 = 5;
24/**
25 * According to https://webassembly.github.io/spec/core/binary/values.html#binary-int
26 * max = ceil(64/7)
27 */
28
29exports.MAX_NUMBER_OF_BYTE_U32 = MAX_NUMBER_OF_BYTE_U32;
30var MAX_NUMBER_OF_BYTE_U64 = 10;
31exports.MAX_NUMBER_OF_BYTE_U64 = MAX_NUMBER_OF_BYTE_U64;
32
33function decodeInt64(encodedBuffer, index) {
34 return _leb.default.decodeInt64(encodedBuffer, index);
35}
36
37function decodeUInt64(encodedBuffer, index) {
38 return _leb.default.decodeUInt64(encodedBuffer, index);
39}
40
41function decodeInt32(encodedBuffer, index) {
42 return _leb.default.decodeInt32(encodedBuffer, index);
43}
44
45function decodeUInt32(encodedBuffer, index) {
46 return _leb.default.decodeUInt32(encodedBuffer, index);
47}
48
49function encodeU32(v) {
50 return _leb.default.encodeUInt32(v);
51}
52
53function encodeI32(v) {
54 return _leb.default.encodeInt32(v);
55}
56
57function encodeI64(v) {
58 return _leb.default.encodeInt64(v);
59}
Note: See TracBrowser for help on using the repository browser.