wakoopa-rbfnv 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/Rakefile +1 -17
  2. data/ext/fnv/fnv.c +4 -4
  3. metadata +22 -43
data/Rakefile CHANGED
@@ -1,19 +1,3 @@
1
1
  require 'rake/extensiontask'
2
2
 
3
- spec = Gem::Specification.new do |s|
4
- s.name = "wakoopa-rbfnv"
5
- s.authors = ["Robey Pointer", "Menno van der Sman"]
6
- s.summary = "FNV hash implementation for ruby"
7
- s.version = '0.1.0'
8
- s.platform = Gem::Platform::RUBY
9
- s.files = FileList['lib/**/*.rb', 'ext/**/*', '[A-Z]*', 'test/**/*'].to_a
10
- s.extensions = FileList["ext/**/extconf.rb"]
11
- s.has_rdoc = false
12
- s.require_paths = %w(lib ext)
13
- end
14
-
15
- # add your default gem packing task
16
- Rake::GemPackageTask.new(spec) do |pkg|
17
- end
18
-
19
- Rake::ExtensionTask.new('fnv', spec)
3
+ Rake::ExtensionTask.new('fnv')
data/ext/fnv/fnv.c CHANGED
@@ -9,7 +9,7 @@
9
9
  */
10
10
  static inline uint64_t fnv1_64(const char *data, uint32_t len) {
11
11
  uint64_t rv = 0xcbf29ce484222325ULL;
12
- uint64_t i;
12
+ uint32_t i;
13
13
  for (i = 0; i < len; i++) {
14
14
  rv = (rv * PRIME64) ^ (unsigned char)data[i];
15
15
  }
@@ -22,7 +22,7 @@ static inline uint64_t fnv1_64(const char *data, uint32_t len) {
22
22
  */
23
23
  static inline uint64_t fnv1a_64(const char *data, uint32_t len) {
24
24
  uint64_t rv = 0xcbf29ce484222325ULL;
25
- uint64_t i;
25
+ uint32_t i;
26
26
  for (i = 0; i < len; i++) {
27
27
  rv = (rv ^ (unsigned char)data[i]) * PRIME64;
28
28
  }
@@ -33,11 +33,11 @@ static inline uint64_t fnv1a_64(const char *data, uint32_t len) {
33
33
  /* ----- ruby bindings ----- */
34
34
 
35
35
  static VALUE rbfnv_fnv1_64(VALUE self, VALUE data) {
36
- return LL2NUM(fnv1_64(RSTRING(data)->ptr, RSTRING(data)->len));
36
+ return LL2NUM(fnv1_64(RSTRING_PTR(data), RSTRING_LEN(data)));
37
37
  }
38
38
 
39
39
  static VALUE rbfnv_fnv1a_64(VALUE self, VALUE data) {
40
- return LL2NUM(fnv1a_64(RSTRING(data)->ptr, RSTRING(data)->len));
40
+ return LL2NUM(fnv1a_64(RSTRING_PTR(data), RSTRING_LEN(data)));
41
41
  }
42
42
 
43
43
 
metadata CHANGED
@@ -1,74 +1,53 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: wakoopa-rbfnv
3
- version: !ruby/object:Gem::Version
4
- hash: 27
5
- prerelease: false
6
- segments:
7
- - 0
8
- - 1
9
- - 0
10
- version: 0.1.0
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.1
5
+ prerelease:
11
6
  platform: ruby
12
- authors:
7
+ authors:
13
8
  - Robey Pointer
14
9
  - Menno van der Sman
15
10
  autorequire:
16
11
  bindir: bin
17
12
  cert_chain: []
18
-
19
- date: 2011-01-10 00:00:00 +01:00
20
- default_executable:
13
+ date: 2013-01-23 00:00:00.000000000 Z
21
14
  dependencies: []
22
-
23
15
  description:
24
- email:
16
+ email: menno.sman@gmail.com
25
17
  executables: []
26
-
27
- extensions:
18
+ extensions:
28
19
  - ext/fnv/extconf.rb
29
20
  extra_rdoc_files: []
30
-
31
- files:
21
+ files:
32
22
  - lib/rbfnv.rb
33
23
  - ext/fnv/extconf.rb
34
24
  - ext/fnv/fnv.c
35
25
  - Rakefile
36
26
  - README.md
37
27
  - test/unit/fnv_test.rb
38
- has_rdoc: false
39
- homepage:
28
+ homepage: http://github.com/menno/rbfnv
40
29
  licenses: []
41
-
42
30
  post_install_message:
43
31
  rdoc_options: []
44
-
45
- require_paths:
32
+ require_paths:
46
33
  - lib
47
34
  - ext
48
- required_ruby_version: !ruby/object:Gem::Requirement
35
+ required_ruby_version: !ruby/object:Gem::Requirement
49
36
  none: false
50
- requirements:
51
- - - ">="
52
- - !ruby/object:Gem::Version
53
- hash: 3
54
- segments:
55
- - 0
56
- version: "0"
57
- required_rubygems_version: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ! '>='
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ required_rubygems_version: !ruby/object:Gem::Requirement
58
42
  none: false
59
- requirements:
60
- - - ">="
61
- - !ruby/object:Gem::Version
62
- hash: 3
63
- segments:
64
- - 0
65
- version: "0"
43
+ requirements:
44
+ - - ! '>='
45
+ - !ruby/object:Gem::Version
46
+ version: '0'
66
47
  requirements: []
67
-
68
48
  rubyforge_project:
69
- rubygems_version: 1.3.7
49
+ rubygems_version: 1.8.24
70
50
  signing_key:
71
51
  specification_version: 3
72
52
  summary: FNV hash implementation for ruby
73
53
  test_files: []
74
-