cityhash 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- data/{README.rdoc → README.md} +14 -15
- data/cityhash.gemspec +3 -3
- data/lib/cityhash.rb +6 -6
- data/lib/cityhash/version.rb +1 -1
- metadata +4 -4
data/{README.rdoc → README.md}
RENAMED
@@ -1,20 +1,20 @@
|
|
1
|
-
|
1
|
+
### cityhash
|
2
2
|
|
3
3
|
Ruby wrapper for google's cityhash.
|
4
4
|
|
5
|
-
|
6
|
-
|
7
|
-
|
5
|
+
### Install
|
6
|
+
|
7
|
+
gem install cityhash
|
8
8
|
|
9
|
-
|
9
|
+
### Usage
|
10
10
|
|
11
|
-
|
11
|
+
require 'cityhash'
|
12
12
|
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
CityHash.hash64("test") # => 17703940110308125106
|
14
|
+
CityHash.hash64("test", 12345) # => 14900027982776226655
|
15
|
+
CityHash.hash64("test", 12345, 54321) # => 11136353178704814373
|
16
16
|
|
17
|
-
|
17
|
+
### Contributing to cityhash
|
18
18
|
|
19
19
|
* Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet
|
20
20
|
* Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it
|
@@ -24,15 +24,14 @@ Ruby wrapper for google's cityhash.
|
|
24
24
|
* Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
|
25
25
|
* Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
|
26
26
|
|
27
|
-
Authors
|
28
|
-
|
29
|
-
|
27
|
+
### Authors
|
28
|
+
|
29
|
+
#### [Contributors](http://github.com/nashby/cityhash/contributors)
|
30
30
|
- [Johannes Holzfuß](http://github.com/DataWraith)
|
31
31
|
|
32
32
|
[Vasiliy Ermolovich](http://github.com/nashby/)<br/>
|
33
33
|
|
34
|
-
|
34
|
+
### Copyright
|
35
35
|
|
36
36
|
Copyright (c) 2011 nashby. See LICENSE.txt for
|
37
37
|
further details.
|
38
|
-
|
data/cityhash.gemspec
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{cityhash}
|
8
|
-
s.version = "0.2.
|
8
|
+
s.version = "0.2.1"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["nashby"]
|
@@ -14,14 +14,14 @@ Gem::Specification.new do |s|
|
|
14
14
|
s.email = %q{younash@gmail.com}
|
15
15
|
s.extra_rdoc_files = [
|
16
16
|
"LICENSE.txt",
|
17
|
-
"README.
|
17
|
+
"README.md"
|
18
18
|
]
|
19
19
|
s.files = [
|
20
20
|
".document",
|
21
21
|
"Gemfile",
|
22
22
|
"Gemfile.lock",
|
23
23
|
"LICENSE.txt",
|
24
|
-
"README.
|
24
|
+
"README.md",
|
25
25
|
"Rakefile",
|
26
26
|
"cityhash.gemspec",
|
27
27
|
"lib/cityhash.rb",
|
data/lib/cityhash.rb
CHANGED
@@ -24,14 +24,14 @@ module CityHash
|
|
24
24
|
end
|
25
25
|
|
26
26
|
if seed1.nil?
|
27
|
-
return CityHash::Internal.city_hash64(
|
27
|
+
return CityHash::Internal.city_hash64(input_str, len)
|
28
28
|
end
|
29
29
|
|
30
30
|
if seed2.nil?
|
31
|
-
return CityHash::Internal.city_hash64_with_seed(
|
31
|
+
return CityHash::Internal.city_hash64_with_seed(input_str, len, seed1.to_i)
|
32
32
|
end
|
33
33
|
|
34
|
-
return CityHash::Internal.city_hash64_with_seeds(
|
34
|
+
return CityHash::Internal.city_hash64_with_seeds(input_str, len, seed1.to_i, seed2.to_i)
|
35
35
|
end
|
36
36
|
|
37
37
|
def self.hash128(input, seed = nil)
|
@@ -45,11 +45,11 @@ module CityHash
|
|
45
45
|
len = input_str.size
|
46
46
|
end
|
47
47
|
|
48
|
-
if
|
49
|
-
return CityHash::Internal.city_hash128(
|
48
|
+
if seed.nil?
|
49
|
+
return CityHash::Internal.city_hash128(input_str, len)
|
50
50
|
end
|
51
51
|
|
52
|
-
return CityHash::Internal.city_hash128_with_seed(
|
52
|
+
return CityHash::Internal.city_hash128_with_seed(input_str, len, seed.to_i)
|
53
53
|
end
|
54
54
|
|
55
55
|
end
|
data/lib/cityhash/version.rb
CHANGED
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: cityhash
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.2.
|
5
|
+
version: 0.2.1
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- nashby
|
@@ -87,13 +87,13 @@ extensions: []
|
|
87
87
|
|
88
88
|
extra_rdoc_files:
|
89
89
|
- LICENSE.txt
|
90
|
-
- README.
|
90
|
+
- README.md
|
91
91
|
files:
|
92
92
|
- .document
|
93
93
|
- Gemfile
|
94
94
|
- Gemfile.lock
|
95
95
|
- LICENSE.txt
|
96
|
-
- README.
|
96
|
+
- README.md
|
97
97
|
- Rakefile
|
98
98
|
- cityhash.gemspec
|
99
99
|
- lib/cityhash.rb
|
@@ -118,7 +118,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
118
118
|
requirements:
|
119
119
|
- - ">="
|
120
120
|
- !ruby/object:Gem::Version
|
121
|
-
hash:
|
121
|
+
hash: -574838995
|
122
122
|
segments:
|
123
123
|
- 0
|
124
124
|
version: "0"
|