digest-murmurhash 0.2.3 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +16 -0
- data/Rakefile +11 -1
- data/digest-murmurhash.gemspec +3 -3
- data/ext/digest/murmurhash/extconf.rb +1 -2
- data/ext/digest/murmurhash/murmurhash.c +253 -0
- data/ext/digest/murmurhash/murmurhash.h +52 -35
- data/ext/digest/murmurhash/murmurhash1.c +18 -54
- data/ext/digest/murmurhash/murmurhash2.c +17 -56
- data/ext/digest/murmurhash/murmurhash2a.c +18 -42
- data/ext/digest/murmurhash/murmurhash64a.c +87 -0
- data/ext/digest/murmurhash/murmurhash64a.h +13 -0
- data/ext/digest/murmurhash/murmurhash64b.c +93 -0
- data/ext/digest/murmurhash/murmurhash64b.h +13 -0
- data/ext/digest/murmurhash/murmurhash_aligned2.c +87 -0
- data/ext/digest/murmurhash/murmurhash_aligned2.h +13 -0
- data/ext/digest/murmurhash/murmurhash_neutral2.c +87 -0
- data/ext/digest/murmurhash/murmurhash_neutral2.h +13 -0
- data/lib/digest/murmurhash/version.rb +1 -1
- data/spec/bench.rb +21 -31
- data/spec/digest_spec.rb +54 -34
- data/spec/exception_spec.rb +19 -4
- data/spec/mem_spec.rb +3 -6
- data/spec/spec_helper.rb +21 -0
- metadata +15 -7
- data/ext/digest/murmurhash/init.c +0 -39
@@ -1,39 +0,0 @@
|
|
1
|
-
#include "murmurhash.h"
|
2
|
-
#include "murmurhash1.h"
|
3
|
-
#include "murmurhash2.h"
|
4
|
-
#include "murmurhash2a.h"
|
5
|
-
|
6
|
-
void
|
7
|
-
Init_murmurhash(void)
|
8
|
-
{
|
9
|
-
VALUE mDigest, cDigest_StringBuffer;
|
10
|
-
VALUE cDigest_MurmurHash1, cDigest_MurmurHash2, cDigest_MurmurHash2A;
|
11
|
-
|
12
|
-
/* Digest::MurmurHash is require that Digest::StringBuffer */
|
13
|
-
mDigest = rb_path2class("Digest");
|
14
|
-
cDigest_StringBuffer = rb_path2class("Digest::StringBuffer");
|
15
|
-
|
16
|
-
/* class Digest::MurmurHash1 < Digest::StringBuffer */
|
17
|
-
cDigest_MurmurHash1 = rb_define_class_under(mDigest, "MurmurHash1", cDigest_StringBuffer);
|
18
|
-
rb_define_private_method(cDigest_MurmurHash1, "finish", murmur1_finish, 0);
|
19
|
-
rb_define_method(cDigest_MurmurHash1, "to_i", murmur1_to_i, 0);
|
20
|
-
rb_define_singleton_method(cDigest_MurmurHash1, "digest", murmur1_s_digest, -1);
|
21
|
-
rb_define_singleton_method(cDigest_MurmurHash1, "hexdigest", murmur1_s_hexdigest, -1);
|
22
|
-
rb_define_singleton_method(cDigest_MurmurHash1, "rawdigest", murmur1_s_rawdigest, -1);
|
23
|
-
|
24
|
-
/* class Digest::MurmurHash2 < Digest::StringBuffer */
|
25
|
-
cDigest_MurmurHash2 = rb_define_class_under(mDigest, "MurmurHash2", cDigest_StringBuffer);
|
26
|
-
rb_define_private_method(cDigest_MurmurHash2, "finish", murmur2_finish, 0);
|
27
|
-
rb_define_method(cDigest_MurmurHash2, "to_i", murmur2_to_i, 0);
|
28
|
-
rb_define_singleton_method(cDigest_MurmurHash2, "digest", murmur2_s_digest, -1);
|
29
|
-
rb_define_singleton_method(cDigest_MurmurHash2, "hexdigest", murmur2_s_hexdigest, -1);
|
30
|
-
rb_define_singleton_method(cDigest_MurmurHash2, "rawdigest", murmur2_s_rawdigest, -1);
|
31
|
-
|
32
|
-
/* class Digest::MurmurHash2A < Digest::StringBuffer */
|
33
|
-
cDigest_MurmurHash2A = rb_define_class_under(mDigest, "MurmurHash2A", cDigest_StringBuffer);
|
34
|
-
rb_define_private_method(cDigest_MurmurHash2A, "finish", murmur2a_finish, 0);
|
35
|
-
rb_define_method(cDigest_MurmurHash2A, "to_i", murmur2a_to_i, 0);
|
36
|
-
rb_define_singleton_method(cDigest_MurmurHash2A, "digest", murmur2a_s_digest, -1);
|
37
|
-
rb_define_singleton_method(cDigest_MurmurHash2A, "hexdigest", murmur2a_s_hexdigest, -1);
|
38
|
-
rb_define_singleton_method(cDigest_MurmurHash2A, "rawdigest", murmur2a_s_rawdigest, -1);
|
39
|
-
}
|