sampling-hash 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/sampling-hash.rb +9 -5
- data/lib/sampling-hash/version.rb +1 -1
- metadata +14 -14
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c23548b53d3e58d84b8afe14257056af0845c78c
|
4
|
+
data.tar.gz: cb8dde11bb5d817a4d5d8ece28ae6b2fa57e5338
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9970df8f3b947c935fb4f0ffbf1a03d8fda4c77ee78cf0ed5d8548c546c142ce5890e6dcd8324c8d904959739e290d10ffa9c9ba89f7e86a96378f76d4bb7780
|
7
|
+
data.tar.gz: ef3a29c998552fb6578295926a2d73cf223c976053a270af774c53694b74a5a88140bdc4d506186d16b6cb75edb75584125d919da7345d7a36bd616e93d8b4c2
|
data/lib/sampling-hash.rb
CHANGED
@@ -10,11 +10,15 @@ module SamplingHash
|
|
10
10
|
|
11
11
|
hash = XXhash::Internal::StreamingHash.new(seed)
|
12
12
|
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
13
|
+
File.open(path, 'r') do |fd|
|
14
|
+
|
15
|
+
sio = SamplingIO.new(fd)
|
16
|
+
sio.samples do |chunk|
|
17
|
+
hash.update(chunk)
|
18
|
+
end
|
17
19
|
|
18
|
-
|
20
|
+
hash.digest
|
21
|
+
|
22
|
+
end
|
19
23
|
end
|
20
24
|
end
|
metadata
CHANGED
@@ -1,55 +1,55 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sampling-hash
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- FlavourSys Technology GmbH
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-01-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: xxhash
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: 0.2.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: 0.2.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '0'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: minitest
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- -
|
45
|
+
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: '0'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- -
|
52
|
+
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
55
|
description: Calculates deterministic hashes from file samples
|
@@ -59,11 +59,11 @@ executables: []
|
|
59
59
|
extensions: []
|
60
60
|
extra_rdoc_files: []
|
61
61
|
files:
|
62
|
-
- lib/sampling-hash
|
62
|
+
- lib/sampling-hash.rb
|
63
|
+
- lib/sampling-hash/hash.rb
|
63
64
|
- lib/sampling-hash/sampler.rb
|
64
65
|
- lib/sampling-hash/sampling-io.rb
|
65
|
-
- lib/sampling-hash/
|
66
|
-
- lib/sampling-hash.rb
|
66
|
+
- lib/sampling-hash/version.rb
|
67
67
|
homepage: http://github.com/FlavourSys/sampling-hash
|
68
68
|
licenses: []
|
69
69
|
metadata: {}
|
@@ -73,17 +73,17 @@ require_paths:
|
|
73
73
|
- lib
|
74
74
|
required_ruby_version: !ruby/object:Gem::Requirement
|
75
75
|
requirements:
|
76
|
-
- -
|
76
|
+
- - ">="
|
77
77
|
- !ruby/object:Gem::Version
|
78
78
|
version: '0'
|
79
79
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
80
80
|
requirements:
|
81
|
-
- -
|
81
|
+
- - ">="
|
82
82
|
- !ruby/object:Gem::Version
|
83
83
|
version: '0'
|
84
84
|
requirements: []
|
85
85
|
rubyforge_project:
|
86
|
-
rubygems_version: 2.
|
86
|
+
rubygems_version: 2.2.2
|
87
87
|
signing_key:
|
88
88
|
specification_version: 4
|
89
89
|
summary: Sampling hash algorithm for large files
|