crc-turbo 0.2-x86-mingw32 → 0.3-x86-mingw32
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/HISTORY.ja.md +4 -0
- data/README.md +4 -6
- data/ext/crc/crc_imps.h +1 -1
- data/ext/crc/crcturbo.c +162 -176
- data/gemstub.rb +3 -3
- data/lib/crc/2.0/_turbo.so +0 -0
- data/lib/crc/2.1/_turbo.so +0 -0
- data/lib/crc/2.2/_turbo.so +0 -0
- data/lib/crc/2.3/_turbo.so +0 -0
- metadata +8 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e3f7657cd03168447650953f2f45a192ca524a2f
|
4
|
+
data.tar.gz: 7fb40a997e3044b4b8d4111346b4bff5baf7e935
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 758b38d47f51aad43ebee00049730d1f1afdd567822fc71ac2f36f5b63ee7af1a04b6bf96f20850fc1c56bb9fc13f18871c1ccbf8491c64f538cab933e1bea58
|
7
|
+
data.tar.gz: 0d432aeb70d85bcab2f285d8b81510670ace05e1c2829df21fe9152c26ed264021405bb1ef175dfd1ce5ee1acb327c6d4ef8bdd25d0970ed85023862a0954d5b
|
data/HISTORY.ja.md
CHANGED
data/README.md
CHANGED
@@ -12,12 +12,12 @@ Just install this, and to do "require 'crc'" only. Additional other work is not
|
|
12
12
|
* author: dearblue (mailto:dearblue@users.osdn.me)
|
13
13
|
* report issue to: <https://osdn.jp/projects/rutsubo/ticket/>
|
14
14
|
* how to install: ``gem install crc-turbo``
|
15
|
-
* version: 0.
|
15
|
+
* version: 0.3
|
16
16
|
* release quality: thechnical preview
|
17
17
|
* licensing: BSD-2-Clause<br>any parts are under Creative Commons License Zero (CC0 / Public Domain).
|
18
|
-
* dependency gems: crc-0.
|
19
|
-
* dependency external
|
20
|
-
* bundled external
|
18
|
+
* dependency gems: crc-0.3 (<https://rubygems/gems/crc>)
|
19
|
+
* dependency external C libraries: none
|
20
|
+
* bundled external C libraries: none
|
21
21
|
|
22
22
|
|
23
23
|
## How to usage
|
@@ -26,8 +26,6 @@ First, install on your system.
|
|
26
26
|
|
27
27
|
``` shell:shell
|
28
28
|
# gem install crc-turbo
|
29
|
-
.....
|
30
|
-
#
|
31
29
|
```
|
32
30
|
|
33
31
|
And, to do ``require "crc"``.
|
data/ext/crc/crc_imps.h
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
*
|
5
5
|
* This is a general CRC generator.
|
6
6
|
*
|
7
|
-
* It's used slice-by-16 algorithm with byte-order free
|
7
|
+
* It's used slice-by-16 algorithm with byte-order free.
|
8
8
|
* This is based on the Intel's slice-by-eight algorithm.
|
9
9
|
*
|
10
10
|
* Worst point is need more memory!
|
data/ext/crc/crcturbo.c
CHANGED
@@ -16,15 +16,16 @@ enum {
|
|
16
16
|
TABLE_NOTREADY = 0x1000,
|
17
17
|
};
|
18
18
|
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
case
|
23
|
-
case
|
24
|
-
case
|
25
|
-
|
26
|
-
|
27
|
-
}
|
19
|
+
//#define SNNIPET(BITSIZE, AS, TYPE, TOUINT, CONVUINT)
|
20
|
+
#define SWITCH_BY_TYPE(TYPE, SNNIPET) \
|
21
|
+
switch ((TYPE)) { \
|
22
|
+
case TYPE_UINT8_T: { SNNIPET( 8, as8, uint8_t, to_uint8, conv_uint8); break; } \
|
23
|
+
case TYPE_UINT16_T: { SNNIPET( 16, as16, uint16_t, to_uint16, conv_uint16); break; } \
|
24
|
+
case TYPE_UINT32_T: { SNNIPET( 32, as32, uint32_t, to_uint32, conv_uint32); break; } \
|
25
|
+
case TYPE_UINT64_T: { SNNIPET( 64, as64, uint64_t, to_uint64, conv_uint64); break; } \
|
26
|
+
/* case TYPE_UINT128_T: { SNNIPET(128, as128, uint128_t, to_uint128, conv_uint128); break; } */ \
|
27
|
+
default: { rb_bug(" [INVALID TYPE FLAGS: 0x%02X] ", (TYPE)); } \
|
28
|
+
} \
|
28
29
|
|
29
30
|
static inline uint8_t
|
30
31
|
to_uint8(VALUE num)
|
@@ -321,52 +322,50 @@ typedef struct anyuint_t
|
|
321
322
|
};
|
322
323
|
} anyuint_t;
|
323
324
|
|
324
|
-
struct
|
325
|
+
struct crc_module
|
325
326
|
{
|
326
|
-
|
327
|
-
|
327
|
+
uint32_t bitsize:10;
|
328
|
+
uint32_t type:10;
|
329
|
+
uint32_t reflect_input:1;
|
330
|
+
uint32_t reflect_output:1;
|
331
|
+
|
328
332
|
anyuint_t bitmask, polynomial, initial, xorout;
|
329
333
|
const void *table; /* entity is String buffer as instance variable */
|
330
334
|
};
|
331
335
|
|
332
|
-
static VALUE
|
336
|
+
static VALUE cCRC; /* class CRC */
|
333
337
|
static VALUE mUtils; /* module CRC::Utils */
|
334
|
-
static
|
335
|
-
static ID
|
336
|
-
static ID
|
338
|
+
static ID ext_iv_name;
|
339
|
+
static ID ext_iv_module;
|
340
|
+
static ID ext_iv_table_buffer;
|
337
341
|
|
338
|
-
static const rb_data_type_t
|
339
|
-
.wrap_struct_name = "crc-turbo.CRC
|
342
|
+
static const rb_data_type_t ext_type = {
|
343
|
+
.wrap_struct_name = "crc-turbo.CRC.module",
|
340
344
|
.function.dmark = NULL,
|
341
345
|
.function.dsize = NULL,
|
342
346
|
.function.dfree = (void *)-1,
|
343
347
|
};
|
344
348
|
|
345
|
-
static
|
346
|
-
|
347
|
-
{
|
348
|
-
struct generator *p;
|
349
|
-
TypedData_Get_Struct(obj, struct generator, &generator_type, p);
|
350
|
-
if (p) { rb_raise(rb_eArgError, "already initialized object - #<%s:0x%p>", rb_obj_classname(obj), (void *)obj); }
|
351
|
-
}
|
352
|
-
|
353
|
-
static struct generator *
|
354
|
-
get_generator(VALUE obj)
|
349
|
+
static struct crc_module *
|
350
|
+
get_modulep(VALUE obj)
|
355
351
|
{
|
356
|
-
struct
|
357
|
-
|
358
|
-
if (
|
352
|
+
struct crc_module *p;
|
353
|
+
obj = rb_ivar_get(obj, ext_iv_module);
|
354
|
+
if (NIL_P(obj)) { return NULL; }
|
355
|
+
TypedData_Get_Struct(obj, struct crc_module, &ext_type, p);
|
359
356
|
return p;
|
360
357
|
}
|
361
358
|
|
362
|
-
static
|
363
|
-
|
359
|
+
static struct crc_module *
|
360
|
+
get_module(VALUE obj)
|
364
361
|
{
|
365
|
-
|
362
|
+
struct crc_module *p = get_modulep(obj);
|
363
|
+
if (!p) { rb_raise(rb_eTypeError, "wrong initialized object - #<%s:0x%p>", rb_obj_classname(obj), (void *)obj); }
|
364
|
+
return p;
|
366
365
|
}
|
367
366
|
|
368
367
|
static void
|
369
|
-
|
368
|
+
ext_init_args(int argc, VALUE argv[], int *flags, int *bitsize, VALUE *poly, VALUE *init, VALUE *xorout, VALUE *name)
|
370
369
|
{
|
371
370
|
rb_check_arity(argc, 2, 7);
|
372
371
|
*bitsize = NUM2INT(argv[0]);
|
@@ -390,191 +389,180 @@ generator_init_args(int argc, VALUE argv[], int *flags, int *bitsize, VALUE *pol
|
|
390
389
|
*name = (argc > 6 && !NIL_P(argv[6])) ? rb_String(argv[6]) : Qnil;
|
391
390
|
}
|
392
391
|
|
393
|
-
/*
|
394
|
-
* call-seq:
|
395
|
-
* initialize(bitsize, polynomial, initial_state = 0, reflect_input = true, reflect_output = true, xor_output = ~0, name = nil)
|
396
|
-
*/
|
397
392
|
static VALUE
|
398
|
-
|
393
|
+
ext_s_new(int argc, VALUE argv[], VALUE crc)
|
399
394
|
{
|
400
|
-
|
401
|
-
|
402
|
-
|
403
|
-
|
404
|
-
|
405
|
-
|
406
|
-
|
407
|
-
|
408
|
-
|
409
|
-
|
410
|
-
|
411
|
-
|
412
|
-
|
413
|
-
|
414
|
-
|
415
|
-
|
416
|
-
|
417
|
-
|
418
|
-
|
419
|
-
|
420
|
-
|
421
|
-
|
422
|
-
|
423
|
-
|
424
|
-
|
425
|
-
|
426
|
-
|
427
|
-
|
428
|
-
|
429
|
-
|
430
|
-
|
431
|
-
|
432
|
-
|
433
|
-
|
434
|
-
|
395
|
+
if (get_modulep(crc)) {
|
396
|
+
return rb_call_super(argc, argv);
|
397
|
+
} else {
|
398
|
+
int flags, bitsize;
|
399
|
+
VALUE poly, init, xorout, name;
|
400
|
+
ext_init_args(argc, argv, &flags, &bitsize, &poly, &init, &xorout, &name);
|
401
|
+
|
402
|
+
struct crc_module *p;
|
403
|
+
VALUE crcmod = TypedData_Make_Struct(crc, struct crc_module, &ext_type, p);
|
404
|
+
|
405
|
+
p->bitsize = bitsize;
|
406
|
+
p->type = flags & TYPE_MASK;
|
407
|
+
p->reflect_input = ((flags & REFLECT_INPUT) != 0) ? 1 : 0;
|
408
|
+
p->reflect_output = ((flags & REFLECT_OUTPUT) != 0) ? 1 : 0;
|
409
|
+
p->table = NULL;
|
410
|
+
|
411
|
+
/*
|
412
|
+
* bitmask の代入でわざわざ1ビット分を後から行う理由は、
|
413
|
+
* 例えば uint8_t に対して << 8 をすると何もしないため、
|
414
|
+
* これへの対処を目的とする。
|
415
|
+
*/
|
416
|
+
#define SNNIPET_INIT_MOD(BITSIZE, AS, TYPE, TOUINT, CONVUINT) \
|
417
|
+
p->bitmask.AS = ~(~(TYPE)0 << 1 << (bitsize - 1)); \
|
418
|
+
p->polynomial.AS = p->bitmask.AS & TOUINT(poly); \
|
419
|
+
p->initial.AS = p->bitmask.AS & TOUINT(init); \
|
420
|
+
p->xorout.AS = p->bitmask.AS & TOUINT(xorout); \
|
421
|
+
|
422
|
+
SWITCH_BY_TYPE(p->type, SNNIPET_INIT_MOD);
|
423
|
+
|
424
|
+
VALUE newcrc = rb_define_class_id(0, crc);
|
425
|
+
rb_ivar_set(newcrc, ext_iv_module, crcmod);
|
426
|
+
rb_ivar_set(newcrc, ext_iv_name, name);
|
427
|
+
|
428
|
+
rb_extend_object(newcrc, rb_const_get(cCRC, rb_intern("ModuleClass")));
|
429
|
+
rb_define_alias(rb_singleton_class(newcrc), "[]", "new");
|
430
|
+
|
431
|
+
return newcrc;
|
432
|
+
}
|
435
433
|
}
|
436
434
|
|
437
435
|
static VALUE
|
438
|
-
|
436
|
+
ext_bitsize(VALUE t)
|
439
437
|
{
|
440
|
-
return INT2FIX(
|
438
|
+
return INT2FIX(get_module(t)->bitsize);
|
441
439
|
}
|
442
440
|
|
443
441
|
static VALUE
|
444
|
-
|
442
|
+
ext_bitmask(VALUE t)
|
445
443
|
{
|
446
|
-
struct
|
447
|
-
|
448
|
-
|
449
|
-
|
450
|
-
|
451
|
-
|
452
|
-
return conv_uint128(p->bitmask.as128));
|
444
|
+
struct crc_module *p = get_module(t);
|
445
|
+
|
446
|
+
#define SNNIPET_BITMASK(BITSIZE, AS, TYPE, TOUINT, CONVUINT) \
|
447
|
+
return CONVUINT(p->bitmask.AS); \
|
448
|
+
|
449
|
+
SWITCH_BY_TYPE(p->type, SNNIPET_BITMASK);
|
453
450
|
}
|
454
451
|
|
455
452
|
static VALUE
|
456
|
-
|
453
|
+
ext_polynomial(VALUE t)
|
457
454
|
{
|
458
|
-
struct
|
459
|
-
|
460
|
-
|
461
|
-
|
462
|
-
|
463
|
-
|
464
|
-
return conv_uint128(p->polynomial.as128));
|
455
|
+
struct crc_module *p = get_module(t);
|
456
|
+
|
457
|
+
#define SNNIPET_POLYNOMIAL(BITSIZE, AS, TYPE, TOUINT, CONVUINT) \
|
458
|
+
return CONVUINT(p->polynomial.AS); \
|
459
|
+
|
460
|
+
SWITCH_BY_TYPE(p->type, SNNIPET_POLYNOMIAL);
|
465
461
|
}
|
466
462
|
|
467
463
|
static VALUE
|
468
|
-
|
464
|
+
ext_initial_crc(VALUE t)
|
469
465
|
{
|
470
|
-
struct
|
471
|
-
|
472
|
-
|
473
|
-
|
474
|
-
|
475
|
-
|
476
|
-
return conv_uint128(p->initial.as128));
|
466
|
+
struct crc_module *p = get_module(t);
|
467
|
+
|
468
|
+
#define SNNIPET_INITIAL_CRC(BITSIZE, AS, TYPE, TOUINT, CONVUINT) \
|
469
|
+
return CONVUINT(p->initial.AS); \
|
470
|
+
|
471
|
+
SWITCH_BY_TYPE(p->type, SNNIPET_INITIAL_CRC);
|
477
472
|
}
|
478
473
|
|
479
474
|
static VALUE
|
480
|
-
|
475
|
+
ext_table(VALUE t)
|
481
476
|
{
|
482
|
-
struct
|
477
|
+
struct crc_module *p = get_module(t);
|
483
478
|
rb_raise(rb_eNotImpError, "");
|
484
479
|
}
|
485
480
|
|
486
481
|
static VALUE
|
487
|
-
|
482
|
+
ext_reflect_input(VALUE t)
|
488
483
|
{
|
489
|
-
struct
|
490
|
-
return (p->
|
484
|
+
struct crc_module *p = get_module(t);
|
485
|
+
return (p->reflect_input != 0) ? Qtrue : Qfalse;
|
491
486
|
}
|
492
487
|
|
493
488
|
static VALUE
|
494
|
-
|
489
|
+
ext_reflect_output(VALUE t)
|
495
490
|
{
|
496
|
-
struct
|
497
|
-
return (p->
|
491
|
+
struct crc_module *p = get_module(t);
|
492
|
+
return (p->reflect_output != 0) ? Qtrue : Qfalse;
|
498
493
|
}
|
499
494
|
|
500
495
|
static VALUE
|
501
|
-
|
496
|
+
ext_xor_output(VALUE t)
|
502
497
|
{
|
503
|
-
struct
|
504
|
-
|
505
|
-
|
506
|
-
|
507
|
-
|
508
|
-
|
509
|
-
return conv_uint128(p->xorout.as128));
|
498
|
+
struct crc_module *p = get_module(t);
|
499
|
+
|
500
|
+
#define SNNIPET_XOR_OUTPUT(BITSIZE, AS, TYPE, TOUINT, CONVUINT) \
|
501
|
+
return CONVUINT(p->xorout.AS); \
|
502
|
+
|
503
|
+
SWITCH_BY_TYPE(p->type, SNNIPET_XOR_OUTPUT);
|
510
504
|
}
|
511
505
|
|
512
506
|
static VALUE
|
513
|
-
|
507
|
+
ext_name(VALUE t)
|
514
508
|
{
|
515
|
-
//
|
516
|
-
|
509
|
+
// get_module で初期化の確認
|
510
|
+
get_module(t);
|
517
511
|
|
518
|
-
return rb_ivar_get(t,
|
512
|
+
return rb_ivar_get(t, ext_iv_name);
|
519
513
|
}
|
520
514
|
|
521
515
|
static VALUE
|
522
|
-
|
516
|
+
ext_set_name(VALUE t, VALUE name)
|
523
517
|
{
|
524
|
-
//
|
525
|
-
|
518
|
+
// get_module で初期化の確認
|
519
|
+
get_module(t);
|
526
520
|
|
527
|
-
rb_ivar_set(t,
|
521
|
+
rb_ivar_set(t, ext_iv_name, rb_String(name));
|
528
522
|
return name;
|
529
523
|
}
|
530
524
|
|
531
525
|
static VALUE
|
532
|
-
|
526
|
+
ext_update(VALUE t, VALUE seq, VALUE state)
|
533
527
|
{
|
534
|
-
struct
|
528
|
+
struct crc_module *p = get_module(t);
|
535
529
|
rb_check_type(seq, RUBY_T_STRING);
|
536
530
|
const char *q = RSTRING_PTR(seq);
|
537
531
|
const char *qq = q + RSTRING_LEN(seq);
|
538
532
|
|
539
533
|
if (!p->table) {
|
540
|
-
size_t tablebytes = (p->
|
534
|
+
size_t tablebytes = (p->type) * 16 * 256;
|
541
535
|
VALUE tablebuf = rb_str_buf_new(tablebytes);
|
542
536
|
rb_str_set_len(tablebuf, tablebytes);
|
543
537
|
void *table = RSTRING_PTR(tablebuf);
|
544
|
-
if (p->
|
545
|
-
|
546
|
-
|
547
|
-
|
548
|
-
|
549
|
-
crc_build_reflect_tables_u64(p->bitsize, table, p->polynomial.as64, 16),
|
550
|
-
crc_build_reflect_tables_u128(p->bitsize, table, p->polynomial.as128, 16));
|
538
|
+
if (p->reflect_input) {
|
539
|
+
#define SNNIPET_BUILD_REFTABLE(BITSIZE, AS, TYPE, TOUINT, CONVUINT) \
|
540
|
+
crc_build_reflect_tables_u##BITSIZE(p->bitsize, table, p->polynomial.AS, 16); \
|
541
|
+
|
542
|
+
SWITCH_BY_TYPE(p->type, SNNIPET_BUILD_REFTABLE);
|
551
543
|
} else {
|
552
|
-
|
553
|
-
|
554
|
-
|
555
|
-
|
556
|
-
crc_build_tables_u64(p->bitsize, table, p->polynomial.as64, 16),
|
557
|
-
crc_build_tables_u128(p->bitsize, table, p->polynomial.as128, 16));
|
544
|
+
#define SNNIPET_BUILD_TABLE(BITSIZE, AS, TYPE, TOUINT, CONVUINT) \
|
545
|
+
crc_build_tables_u##BITSIZE(p->bitsize, table, p->polynomial.AS, 16); \
|
546
|
+
|
547
|
+
SWITCH_BY_TYPE(p->type, SNNIPET_BUILD_TABLE);
|
558
548
|
}
|
559
|
-
rb_ivar_set(t,
|
549
|
+
rb_ivar_set(t, ext_iv_table_buffer, tablebuf);
|
560
550
|
rb_obj_freeze(tablebuf);
|
561
551
|
p->table = table;
|
562
552
|
}
|
563
553
|
|
564
|
-
if (p->
|
565
|
-
|
566
|
-
|
567
|
-
|
568
|
-
|
569
|
-
|
570
|
-
return conv_uint128(crc_reflect_update_u128(p->bitsize, p->table, q, qq, to_uint128(state))));
|
554
|
+
if (p->reflect_input) {
|
555
|
+
#define SNNIPET_REFUPDATE(BITSIZE, AS, TYPE, TOUINT, CONVUINT) \
|
556
|
+
return CONVUINT(crc_reflect_update_u##BITSIZE( \
|
557
|
+
p->bitsize, p->table, q, qq, TOUINT(state))); \
|
558
|
+
|
559
|
+
SWITCH_BY_TYPE(p->type, SNNIPET_REFUPDATE);
|
571
560
|
} else {
|
572
|
-
|
573
|
-
|
574
|
-
|
575
|
-
|
576
|
-
|
577
|
-
return conv_uint128(crc_update_u128(p->bitsize, p->table, q, qq, to_uint128(state))));
|
561
|
+
#define SNNIPET_UPDATE(BITSIZE, AS, TYPE, TOUINT, CONVUINT) \
|
562
|
+
return CONVUINT(crc_update_u##BITSIZE( \
|
563
|
+
p->bitsize, p->table, q, qq, TOUINT(state))); \
|
564
|
+
|
565
|
+
SWITCH_BY_TYPE(p->type, SNNIPET_UPDATE);
|
578
566
|
}
|
579
567
|
}
|
580
568
|
|
@@ -639,30 +627,28 @@ utils_s_bitref128(VALUE mod, VALUE num)
|
|
639
627
|
void
|
640
628
|
Init__turbo(void)
|
641
629
|
{
|
642
|
-
|
643
|
-
|
644
|
-
|
645
|
-
|
646
|
-
|
647
|
-
|
630
|
+
ext_iv_name = rb_intern("crc-turbo.CRC.name");
|
631
|
+
ext_iv_module = rb_intern("crc-turbo.CRC.module");
|
632
|
+
ext_iv_table_buffer = rb_intern("crc-turbo.CRC.table-buffer");
|
633
|
+
|
634
|
+
cCRC = rb_define_class("CRC", rb_cObject);
|
635
|
+
rb_define_singleton_method(cCRC, "new", ext_s_new, -1);
|
636
|
+
rb_define_singleton_method(cCRC, "bitsize", ext_bitsize, 0);
|
637
|
+
rb_define_singleton_method(cCRC, "bitmask", ext_bitmask, 0);
|
638
|
+
rb_define_singleton_method(cCRC, "polynomial", ext_polynomial, 0);
|
639
|
+
rb_define_singleton_method(cCRC, "initial_crc", ext_initial_crc, 0);
|
640
|
+
rb_define_singleton_method(cCRC, "table", ext_table, 0);
|
641
|
+
rb_define_singleton_method(cCRC, "reflect_input?", ext_reflect_input, 0);
|
642
|
+
rb_define_singleton_method(cCRC, "reflect_output?", ext_reflect_output, 0);
|
643
|
+
rb_define_singleton_method(cCRC, "xor_output", ext_xor_output, 0);
|
644
|
+
rb_define_singleton_method(cCRC, "name", ext_name, 0);
|
645
|
+
rb_define_singleton_method(cCRC, "name=", ext_set_name, 1);
|
646
|
+
rb_define_singleton_method(cCRC, "update", ext_update, 2);
|
647
|
+
|
648
|
+
mUtils = rb_define_module_under(cCRC, "Utils");
|
648
649
|
rb_define_method(mUtils, "bitreflect8", utils_s_bitref8, 1);
|
649
650
|
rb_define_method(mUtils, "bitreflect16", utils_s_bitref16, 1);
|
650
651
|
rb_define_method(mUtils, "bitreflect32", utils_s_bitref32, 1);
|
651
652
|
rb_define_method(mUtils, "bitreflect64", utils_s_bitref64, 1);
|
652
653
|
rb_define_method(mUtils, "bitreflect128", utils_s_bitref128, 1);
|
653
|
-
|
654
|
-
cGenerator = rb_define_class_under(mCRC, "Generator", rb_cObject);
|
655
|
-
rb_define_alloc_func(cGenerator, generator_alloc);
|
656
|
-
rb_define_method(cGenerator, "initialize", generator_init, -1);
|
657
|
-
rb_define_method(cGenerator, "bitsize", generator_bitsize, 0);
|
658
|
-
rb_define_method(cGenerator, "bitmask", generator_bitmask, 0);
|
659
|
-
rb_define_method(cGenerator, "polynomial", generator_polynomial, 0);
|
660
|
-
rb_define_method(cGenerator, "initial_state", generator_initial_state, 0);
|
661
|
-
rb_define_method(cGenerator, "table", generator_table, 0);
|
662
|
-
rb_define_method(cGenerator, "reflect_input", generator_reflect_input, 0);
|
663
|
-
rb_define_method(cGenerator, "reflect_output", generator_reflect_output, 0);
|
664
|
-
rb_define_method(cGenerator, "xor_output", generator_xor_output, 0);
|
665
|
-
rb_define_method(cGenerator, "name", generator_name, 0);
|
666
|
-
rb_define_method(cGenerator, "name=", generator_set_name, 1);
|
667
|
-
rb_define_method(cGenerator, "update", generator_update, 2);
|
668
654
|
}
|
data/gemstub.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
GEMSTUB = Gem::Specification.new do |s|
|
2
2
|
s.name = "crc-turbo"
|
3
|
-
s.version = "0.
|
3
|
+
s.version = "0.3"
|
4
4
|
s.summary = "general CRC generator"
|
5
5
|
s.description = <<EOS
|
6
6
|
This is a C extention for "crc" gem library.
|
@@ -12,8 +12,8 @@ EOS
|
|
12
12
|
s.email = "dearblue@users.osdn.me"
|
13
13
|
|
14
14
|
s.required_ruby_version = ">= 2.0"
|
15
|
-
s.add_development_dependency "rake"
|
16
|
-
s.add_runtime_dependency "crc", "~> 0.
|
15
|
+
s.add_development_dependency "rake"
|
16
|
+
s.add_runtime_dependency "crc", "~> 0.3"
|
17
17
|
end
|
18
18
|
|
19
19
|
EXTMAP["crc"] = "crc/_turbo"
|
data/lib/crc/2.0/_turbo.so
CHANGED
Binary file
|
data/lib/crc/2.1/_turbo.so
CHANGED
Binary file
|
data/lib/crc/2.2/_turbo.so
CHANGED
Binary file
|
data/lib/crc/2.3/_turbo.so
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,43 +1,43 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: crc-turbo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '0.
|
4
|
+
version: '0.3'
|
5
5
|
platform: x86-mingw32
|
6
6
|
authors:
|
7
7
|
- dearblue
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-07-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '0'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - "
|
24
|
+
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
26
|
+
version: '0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: crc
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '0.
|
33
|
+
version: '0.3'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '0.
|
40
|
+
version: '0.3'
|
41
41
|
description: |
|
42
42
|
This is a C extention for "crc" gem library.
|
43
43
|
Just install this, and to do "require 'crc'" only. Additional other work is not required.
|
@@ -93,4 +93,3 @@ signing_key:
|
|
93
93
|
specification_version: 4
|
94
94
|
summary: general CRC generator
|
95
95
|
test_files: []
|
96
|
-
has_rdoc:
|