yencode 1.2.1 → 1.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/binding.gyp CHANGED
@@ -2,14 +2,15 @@
2
2
  "variables": {
3
3
  "enable_native_tuning%": 1,
4
4
  "disable_avx256%": 0,
5
- "disable_crcutil%": 0
5
+ "disable_crcutil%": 0,
6
+ "built_with_electron%": 0
6
7
  },
7
8
  "target_defaults": {
8
9
  "conditions": [
9
10
  ['target_arch=="ia32"', {
10
11
  "msvs_settings": {"VCCLCompilerTool": {"EnableEnhancedInstructionSet": "2"}}
11
12
  }],
12
- ['OS!="win" and enable_native_tuning!=0', {
13
+ ['OS!="win" and enable_native_tuning!=0 and target_arch==host_arch and (built_with_electron==0 or host_arch!="x64")', {
13
14
  "variables": {
14
15
  "supports_native%": "<!(<!(echo ${CXX_target:-${CXX:-c++}}) -MM -E src/common.h -march=native 2>/dev/null || true)"
15
16
  },
@@ -20,7 +21,8 @@
20
21
  "xcode_settings": {
21
22
  "OTHER_CFLAGS": ["-march=native"],
22
23
  "OTHER_CXXFLAGS": ["-march=native"],
23
- }
24
+ },
25
+ "defines": ["YENC_BUILD_NATIVE=1"]
24
26
  }]
25
27
  ]
26
28
  }],
@@ -45,12 +47,9 @@
45
47
  ['disable_crcutil!=0', {
46
48
  "defines": ["YENC_DISABLE_CRCUTIL=1"]
47
49
  }],
48
- ['OS!="win" and enable_native_tuning!=0', {
49
- "defines": ["YENC_BUILD_NATIVE=1"]
50
- }],
51
50
  ['OS!="win"', {
52
51
  "variables": {
53
- "missing_memalign%": "<!(<!(echo ${CC_target:-${CC:-cc}}) -c src/test_alignalloc.c -o /dev/null -Werror 2>/dev/null || echo failed)",
52
+ "missing_memalign%": "<!(<!(echo ${CXX_target:-${CXX:-c++}}) -c src/test_alignalloc.cc -o /dev/null -Werror 2>/dev/null || echo failed)",
54
53
  },
55
54
  "conditions": [
56
55
  ['missing_memalign!=""', {
@@ -60,7 +59,7 @@
60
59
  }]
61
60
  ],
62
61
  "cflags": ["-Wno-unused-function"],
63
- "cxxflags": ["-Wno-unused-function", "-std=c++03", "-D_POSIX_C_SOURCE=200112L"],
62
+ "cxxflags": ["-Wno-unused-function", "-std=c++03"],
64
63
  "xcode_settings": {
65
64
  "OTHER_CFLAGS": ["-Wno-unused-function"],
66
65
  "OTHER_CXXFLAGS": ["-Wno-unused-function"]
package/index.js CHANGED
@@ -3,6 +3,7 @@
3
3
  var y = require('./build/Release/yencode.node');
4
4
 
5
5
  var toBuffer = Buffer.alloc ? Buffer.from : Buffer;
6
+ var allocBuffer = (Buffer.allocUnsafe || Buffer);
6
7
  var bufferSlice = Buffer.prototype.readBigInt64BE ? Buffer.prototype.subarray : Buffer.prototype.slice;
7
8
 
8
9
  var nl = toBuffer([13, 10]);
@@ -125,9 +126,17 @@ var propIsNotValidNumber = function(prop) {
125
126
  module.exports = {
126
127
  encoding: 'utf8',
127
128
 
128
- encode: y.encode,
129
+ encode: y.encode || function(data, line_size, column_offset) {
130
+ var buffer = allocBuffer(module.exports.maxSize(data.length, line_size));
131
+ var length = y.encodeTo(data, buffer, line_size, column_offset);
132
+ return bufferSlice.call(buffer, 0, length);
133
+ },
129
134
  encodeTo: y.encodeTo,
130
- decode: y.decode,
135
+ decode: y.decode || function(data, stripDots) {
136
+ var buffer = allocBuffer(data.length);
137
+ var length = y.decodeTo(data, buffer, stripDots);
138
+ return bufferSlice.call(buffer, 0, length);
139
+ },
131
140
  decodeTo: y.decodeTo,
132
141
 
133
142
  decodeChunk: function(data, output, prev) {
@@ -157,7 +166,13 @@ module.exports = {
157
166
  }
158
167
  if(state < 0) state = decodePrev.indexOf('');
159
168
  }
160
- var ret = y.decodeIncr(data, state, output);
169
+ var ret;
170
+ if(!output && !y.decode) {
171
+ output = allocBuffer(data.length);
172
+ ret = y.decodeIncr(data, state, output);
173
+ ret.output = bufferSlice.call(output, 0, ret.written);
174
+ } else
175
+ ret = y.decodeIncr(data, state, output);
161
176
 
162
177
  return {
163
178
  read: ret.read,
@@ -199,13 +214,17 @@ module.exports = {
199
214
  if(!Buffer.isBuffer(data)) data = toBuffer(data);
200
215
 
201
216
  filename = toBuffer(filename.replace(RE_BADCHAR, '').substring(0, 256), exports.encoding);
202
- var e = encodeCrc(data, line_size);
203
- return Buffer.concat([
204
- toBuffer('=ybegin line='+line_size+' size='+data.length+' name='),
205
- filename, nl,
206
- e.output,
207
- toBuffer('\r\n=yend size='+data.length+' crc32=' + e.crc32.toString('hex'))
208
- ]);
217
+
218
+ var yBegin = '=ybegin line='+line_size+' size='+data.length+' name=';
219
+ var yEnd = '\r\n=yend size='+data.length+' crc32=';
220
+ var ret = allocBuffer(yBegin.length + filename.length + 2 + module.exports.maxSize(data.length, line_size) + yEnd.length + 8);
221
+
222
+ var writePos = ret.write(yBegin);
223
+ writePos += filename.copy(ret, writePos);
224
+ writePos += nl.copy(ret, writePos);
225
+ writePos += y.encodeTo(data, bufferSlice.call(ret, writePos), line_size);
226
+ writePos += ret.write(yEnd + y.crc32(data).toString('hex'), writePos);
227
+ return bufferSlice.call(ret, 0, writePos);
209
228
  },
210
229
  multi_post: function(filename, size, parts, line_size) {
211
230
  return new YEncoder(filename, size, parts, line_size);
@@ -325,7 +344,7 @@ module.exports = {
325
344
  warnings.push(DecoderWarning('size_mismatch', 'Size specified for part exceeds size specified for whole file'));
326
345
 
327
346
  if(ret.dataStart) {
328
- ret.data = y.decode(bufferSlice.call(data, ret.dataStart, ret.dataEnd), !!isRaw);
347
+ ret.data = module.exports.decode(bufferSlice.call(data, ret.dataStart, ret.dataEnd), !!isRaw);
329
348
  ret.crc32 = y.crc32(ret.data);
330
349
  var hexCrc = ret.crc32.toString('hex');
331
350
 
@@ -403,16 +422,19 @@ YEncoder.prototype = {
403
422
  this.yInfo = null;
404
423
  }
405
424
 
406
- var ret = Buffer.concat([
407
- toBuffer('=ybegin part='+this.part),
408
- yInfo,
409
- toBuffer('=ypart begin='+( this.pos+1 )+' end='+end+'\r\n'),
410
- y.encode(data, this.line_size),
411
- toBuffer('\r\n=yend size='+data.length+' part='+this.part+' pcrc32='+crc.toString('hex')+fullCrc)
412
- ]);
425
+ var yBegin = '=ybegin part='+this.part;
426
+ var yPart = '=ypart begin='+( this.pos+1 )+' end='+end+'\r\n';
427
+ var yEnd = '\r\n=yend size='+data.length+' part='+this.part+' pcrc32='+crc.toString('hex')+fullCrc;
428
+ var ret = allocBuffer(yBegin.length + yInfo.length + yPart.length + module.exports.maxSize(data.length, this.line_size) + yEnd.length);
429
+
430
+ var writePos = ret.write(yBegin);
431
+ writePos += yInfo.copy(ret, writePos);
432
+ writePos += ret.write(yPart, writePos);
433
+ writePos += y.encodeTo(data, bufferSlice.call(ret, writePos), this.line_size);
434
+ writePos += ret.write(yEnd, writePos);
413
435
 
414
436
  this.pos = end;
415
- return ret;
437
+ return bufferSlice.call(ret, 0, writePos);
416
438
  },
417
439
 
418
440
  _encodeSingle: function(data) {
@@ -428,10 +450,12 @@ YEncoder.prototype = {
428
450
 
429
451
  var yInfo = this.yInfo;
430
452
  this.yInfo = null;
431
- return Buffer.concat([
432
- yInfo,
433
- y.encode(data, this.line_size),
434
- toBuffer('\r\n=yend size='+data.length+' crc32=' + this.crc.toString('hex'))
435
- ]);
453
+
454
+ var tail = '\r\n=yend size='+data.length+' crc32=' + this.crc.toString('hex');
455
+ var ret = allocBuffer(yInfo.length + module.exports.maxSize(data.length, this.line_size) + tail.length);
456
+ var writePos = yInfo.copy(ret);
457
+ writePos += y.encodeTo(data, bufferSlice.call(ret, writePos), this.line_size);
458
+ writePos += ret.write(tail, writePos);
459
+ return bufferSlice.call(ret, 0, writePos);
436
460
  }
437
461
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "yencode",
3
- "version": "1.2.1",
3
+ "version": "1.2.4",
4
4
  "description": "SIMD accelerated yEnc encoder/decoder and CRC32 calculator",
5
5
  "keywords": [
6
6
  "yenc",
package/src/common.h CHANGED
@@ -40,6 +40,11 @@
40
40
  // MSVC doesn't support C11 aligned_alloc: https://stackoverflow.com/a/62963007
41
41
  #define ALIGN_ALLOC(buf, len, align) *(void**)&(buf) = _aligned_malloc((len), align)
42
42
  #define ALIGN_FREE _aligned_free
43
+ #elif defined(__ANDROID__)
44
+ // Android NDK may have broken std::aligned_alloc [https://github.com/android/ndk/issues/1339]
45
+ #include <malloc.h>
46
+ #define ALIGN_ALLOC(buf, len, align) *(void**)&(buf) = memalign(align, (len))
47
+ #define ALIGN_FREE free
43
48
  #elif defined(_ISOC11_SOURCE)
44
49
  // C11 method
45
50
  // len needs to be a multiple of alignment, although it sometimes works if it isn't...
package/src/crc.cc CHANGED
@@ -198,15 +198,13 @@ namespace RapidYenc {
198
198
  # include <Windows.h>
199
199
  #endif
200
200
  #ifdef PLATFORM_ARM
201
- # ifdef __ANDROID__
202
- # include <cpu-features.h>
203
- # elif defined(__APPLE__)
201
+ # if defined(__APPLE__)
204
202
  # include <sys/types.h>
205
203
  # include <sys/sysctl.h>
206
204
  # elif defined(__has_include)
207
205
  # if __has_include(<sys/auxv.h>)
208
206
  # include <sys/auxv.h>
209
- # ifdef __FreeBSD__
207
+ # if defined(__FreeBSD__) || defined(__OpenBSD__)
210
208
  static unsigned long getauxval(unsigned long cap) {
211
209
  unsigned long ret;
212
210
  elf_aux_info(cap, &ret, sizeof(ret));
@@ -217,6 +215,9 @@ static unsigned long getauxval(unsigned long cap) {
217
215
  # include <asm/hwcap.h>
218
216
  # endif
219
217
  # endif
218
+ # if defined(__ANDROID__) && __has_include(<cpu-features.h>)
219
+ # include <cpu-features.h>
220
+ # endif
220
221
  # endif
221
222
  #endif
222
223
  #if defined(__riscv) && defined(__has_include)
package/src/crc.h CHANGED
@@ -23,7 +23,7 @@ static inline int crc32_isa_level() {
23
23
 
24
24
  // computes `n % 0xffffffff` (well, almost), using some bit-hacks
25
25
  static inline uint32_t crc32_powmod(uint64_t n) {
26
- #ifdef __GNUC__
26
+ #if defined(__GNUC__) && (__GNUC__ >= 5 || (defined(__clang__) && (__clang_major__ > 3 || (__clang_major__ == 3 && __clang_minor__ > 3))))
27
27
  unsigned res;
28
28
  unsigned carry = __builtin_uadd_overflow(n >> 32, n, &res);
29
29
  res += carry;
@@ -207,7 +207,7 @@ static uint32_t crc32_shift_pmull(uint32_t crc1, uint32_t n) {
207
207
  void RapidYenc::crc_pmull_set_funcs() {
208
208
  _crc32_multiply = &crc32_multiply_pmull;
209
209
  _crc32_shift = &crc32_shift_pmull;
210
- _crc32_isa &= ISA_FEATURE_PMULL;
210
+ _crc32_isa |= ISA_FEATURE_PMULL;
211
211
  }
212
212
 
213
213
  #else
@@ -209,7 +209,8 @@ HEDLEY_ALWAYS_INLINE void do_decode_rvv(const uint8_t* src, long& len, unsigned
209
209
  if(LIKELIHOOD(0.0001, RV(vcpop_m_b4)(RV(vmandn_mm_b4)(cmpEqShift1, cmp, vl2), vl2) != 0)) {
210
210
  // replicate fix_eqMask, but in vector form
211
211
  vbool4_t groupStart = RV(vmandn_mm_b4)(cmpEq, cmpEqShift1, vl2);
212
- vbool4_t evenBits = RV_MASK_CAST(4, 8, RV(vmv_v_x_u8m1)(0x55, vl2));
212
+ vuint8m1_t evenBitsV = RV(vmv_v_x_u8m1)(0x55, vl2);
213
+ vbool4_t evenBits = RV_MASK_CAST(4, 8, evenBitsV);
213
214
  vbool4_t evenStart = RV(vmand_mm_b4)(groupStart, evenBits, vl2);
214
215
 
215
216
  // compute `cmpEq + evenStart` to obtain oddGroups
@@ -217,12 +217,12 @@ HEDLEY_ALWAYS_INLINE void do_encode_avx2(int line_size, int* colOffset, const ui
217
217
  // duplicate halves
218
218
  data1A = _mm256_inserti128_si256(dataA, _mm256_castsi256_si128(dataA), 1);
219
219
  data1B = _mm256_inserti128_si256(dataB, _mm256_castsi256_si128(dataB), 1);
220
- #if defined(__tune_znver2__) || defined(__tune_znver3__) || defined(__tune_znver4__)
221
- data2A = _mm256_permute2x128_si256(dataA, dataA, 0x11);
222
- data2B = _mm256_permute2x128_si256(dataB, dataB, 0x11);
223
- #else
220
+ #if defined(__tune_znver1__) || defined(__tune_bdver4__)
224
221
  data2A = _mm256_permute4x64_epi64(dataA, 0xee);
225
222
  data2B = _mm256_permute4x64_epi64(dataB, 0xee);
223
+ #else
224
+ data2A = _mm256_permute2x128_si256(dataA, dataA, 0x11);
225
+ data2B = _mm256_permute2x128_si256(dataB, dataB, 0x11);
226
226
  #endif
227
227
 
228
228
  shuf1A = _mm256_load_si256(lookupsAVX2->shufExpand + m1);
@@ -351,7 +351,7 @@ HEDLEY_ALWAYS_INLINE void do_encode_sse(int line_size, int* colOffset, const uin
351
351
  #if defined(__POPCNT__) && !defined(__tune_btver1__)
352
352
  if(use_isa & ISA_FEATURE_POPCNT) {
353
353
  shuf2Len = popcnt32(maskA) + 16;
354
- # if defined(__tune_znver4__) || defined(__tune_znver3__) || defined(__tune_znver2__) || defined(__tune_znver1__) || defined(__tune_btver2__)
354
+ # if defined(__tune_znver6__) || defined(__tune_znver5__) || defined(__tune_znver4__) || defined(__tune_znver3__) || defined(__tune_znver2__) || defined(__tune_znver1__) || defined(__tune_btver2__)
355
355
  shuf1Len = popcnt32(m1) + 8;
356
356
  shuf3Len = popcnt32(m3) + shuf2Len + 8;
357
357
  # else
package/src/platform.cc CHANGED
@@ -1,8 +1,6 @@
1
1
  #include "common.h"
2
2
  #ifdef PLATFORM_ARM
3
- # ifdef __ANDROID__
4
- # include <cpu-features.h>
5
- # elif defined(_WIN32)
3
+ # if defined(_WIN32)
6
4
  # define WIN32_LEAN_AND_MEAN
7
5
  # define NOMINMAX
8
6
  # include <Windows.h>
@@ -16,10 +14,13 @@
16
14
  # include <asm/hwcap.h>
17
15
  # endif
18
16
  # endif
17
+ # if defined(__ANDROID__) && __has_include(<cpu-features.h>)
18
+ # include <cpu-features.h>
19
+ # endif
19
20
  # endif
20
21
  bool RapidYenc::cpu_supports_neon() {
21
22
  # if defined(AT_HWCAP)
22
- # ifdef __FreeBSD__
23
+ # if defined(__FreeBSD__) || defined(__OpenBSD__)
23
24
  unsigned long supported;
24
25
  elf_aux_info(AT_HWCAP, &supported, sizeof(supported));
25
26
  # ifdef __aarch64__
@@ -139,11 +140,7 @@ int RapidYenc::cpu_supports_isa() {
139
140
  if(cpuInfo2[3] & 0x80000) {
140
141
  _cpuidX(cpuInfo2, 0x24, 0);
141
142
  if((cpuInfo2[1] & 0xff) >= 1 && ( // minimum AVX10.1
142
- #ifdef YENC_DISABLE_AVX256
143
- cpuInfo2[1] & 0x10000 // AVX10/128
144
- #else
145
- cpuInfo2[1] & 0x20000 // AVX10/256
146
- #endif
143
+ cpuInfo2[1] & 0x20000 // AVX10/256 (AVX10/128 is now invalid)
147
144
  )) {
148
145
  if(cpuInfo2[1] & 0x40000) ret |= ISA_FEATURE_EVEX512;
149
146
  return ret | ISA_LEVEL_VBMI2;
@@ -204,7 +201,7 @@ int RapidYenc::cpu_supports_crc_isa() {
204
201
  bool RapidYenc::cpu_supports_rvv() {
205
202
  # if defined(AT_HWCAP)
206
203
  unsigned long ret;
207
- # ifdef __FreeBSD__
204
+ # if defined(__FreeBSD__) || defined(__OpenBSD__)
208
205
  elf_aux_info(AT_HWCAP, &ret, sizeof(ret));
209
206
  # else
210
207
  ret = getauxval(AT_HWCAP);
package/src/yencode.cc CHANGED
@@ -13,6 +13,11 @@
13
13
  using namespace v8;
14
14
  using namespace RapidYenc;
15
15
 
16
+ #ifdef V8_ENABLE_SANDBOX
17
+ // V8 Memory Cage is enabled - no external buffers allowed
18
+ # define YENC_NO_EXTERNAL_BUFFER 1
19
+ #endif
20
+
16
21
  static void free_buffer(char* data, void* _size) {
17
22
  #if !NODE_VERSION_AT_LEAST(0, 11, 0)
18
23
  int size = (int)(size_t)_size;
@@ -101,6 +106,7 @@ static inline size_t YENC_MAX_SIZE(size_t len, size_t line_size) {
101
106
  #endif
102
107
 
103
108
 
109
+ #ifndef YENC_NO_EXTERNAL_BUFFER
104
110
  // encode(str, line_size, col)
105
111
  FUNC(Encode) {
106
112
  FUNC_START;
@@ -135,6 +141,7 @@ FUNC(Encode) {
135
141
  MARK_EXT_MEM(len);
136
142
  RETURN_VAL( NEW_BUFFER((char*)result, len, free_buffer, (void*)len) );
137
143
  }
144
+ #endif
138
145
 
139
146
  FUNC(EncodeTo) {
140
147
  FUNC_START;
@@ -205,6 +212,9 @@ FUNC(EncodeIncr) {
205
212
  }
206
213
  }
207
214
  }
215
+ #ifdef YENC_NO_EXTERNAL_BUFFER
216
+ if(allocResult) RETURN_ERROR("Destination buffer must be supplied as buffer allocation isn't enabled in this build");
217
+ #endif
208
218
 
209
219
  Local<Object> ret = NEW_OBJECT;
210
220
 
@@ -215,24 +225,29 @@ FUNC(EncodeIncr) {
215
225
  RETURN_VAL( ret );
216
226
  }
217
227
 
228
+ #ifndef YENC_NO_EXTERNAL_BUFFER
218
229
  if(allocResult) {
219
230
  // allocate enough memory to handle worst case requirements
220
231
  size_t dest_len = YENC_MAX_SIZE(arg_len, line_size);
221
232
  result = (unsigned char*) malloc(dest_len);
222
233
  }
234
+ #endif
223
235
 
224
236
  size_t len = encode(line_size, &col, (const unsigned char*)node::Buffer::Data(args[0]), result, arg_len, false);
225
237
 
226
238
  SET_OBJ(ret, "written", Integer::New(ISOLATE len));
239
+ #ifndef YENC_NO_EXTERNAL_BUFFER
227
240
  if(allocResult) {
228
241
  result = (unsigned char*)realloc(result, len);
229
242
  SET_OBJ(ret, "output", NEW_BUFFER((char*)result, len, free_buffer, (void*)len));
230
243
  MARK_EXT_MEM(len);
231
244
  }
245
+ #endif
232
246
  SET_OBJ(ret, "col", Integer::New(ISOLATE col));
233
247
  RETURN_VAL( ret );
234
248
  }
235
249
 
250
+ #ifndef YENC_NO_EXTERNAL_BUFFER
236
251
  FUNC(Decode) {
237
252
  FUNC_START;
238
253
 
@@ -253,6 +268,7 @@ FUNC(Decode) {
253
268
  MARK_EXT_MEM(len);
254
269
  RETURN_VAL( NEW_BUFFER((char*)result, len, free_buffer, (void*)len) );
255
270
  }
271
+ #endif
256
272
 
257
273
  FUNC(DecodeTo) {
258
274
  FUNC_START;
@@ -301,6 +317,10 @@ FUNC(DecodeIncr) {
301
317
  }
302
318
  }
303
319
 
320
+ #ifdef YENC_NO_EXTERNAL_BUFFER
321
+ if(allocResult) RETURN_ERROR("Destination buffer must be supplied as buffer allocation isn't enabled in this build");
322
+ #endif
323
+
304
324
  const unsigned char* src = (const unsigned char*)node::Buffer::Data(args[0]);
305
325
  const unsigned char* sp = src;
306
326
  #ifdef DBG_ALIGN_SOURCE
@@ -309,11 +329,15 @@ FUNC(DecodeIncr) {
309
329
  sp = (const unsigned char*)newSrc;
310
330
  #endif
311
331
 
332
+ #ifndef YENC_NO_EXTERNAL_BUFFER
312
333
  if(allocResult) result = (unsigned char*) malloc(arg_len);
334
+ #endif
313
335
  unsigned char* dp = result;
314
336
  YencDecoderEnd ended = RapidYenc::decode_end((const void**)&sp, (void**)&dp, arg_len, &state);
315
337
  size_t len = dp - result;
338
+ #ifndef YENC_NO_EXTERNAL_BUFFER
316
339
  if(allocResult) result = (unsigned char*)realloc(result, len);
340
+ #endif
317
341
 
318
342
  #ifdef DBG_ALIGN_SOURCE
319
343
  free(newSrc);
@@ -322,10 +346,12 @@ FUNC(DecodeIncr) {
322
346
  Local<Object> ret = NEW_OBJECT;
323
347
  SET_OBJ(ret, "read", Integer::New(ISOLATE sp - src));
324
348
  SET_OBJ(ret, "written", Integer::New(ISOLATE len));
349
+ #ifndef YENC_NO_EXTERNAL_BUFFER
325
350
  if(allocResult) {
326
351
  SET_OBJ(ret, "output", NEW_BUFFER((char*)result, len, free_buffer, (void*)len));
327
352
  MARK_EXT_MEM(len);
328
353
  }
354
+ #endif
329
355
  SET_OBJ(ret, "ended", Integer::New(ISOLATE (int)ended));
330
356
  SET_OBJ(ret, "state", Integer::New(ISOLATE state));
331
357
  RETURN_VAL( ret );
@@ -468,10 +494,12 @@ void yencode_init(
468
494
  )
469
495
  #endif
470
496
  {
497
+ #ifndef YENC_NO_EXTERNAL_BUFFER
471
498
  NODE_SET_METHOD(exports, "encode", Encode);
499
+ NODE_SET_METHOD(exports, "decode", Decode);
500
+ #endif
472
501
  NODE_SET_METHOD(exports, "encodeTo", EncodeTo);
473
502
  NODE_SET_METHOD(exports, "encodeIncr", EncodeIncr);
474
- NODE_SET_METHOD(exports, "decode", Decode);
475
503
  NODE_SET_METHOD(exports, "decodeTo", DecodeTo);
476
504
  NODE_SET_METHOD(exports, "decodeIncr", DecodeIncr);
477
505
  NODE_SET_METHOD(exports, "crc32", CRC32);
File without changes