sfh 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/History.txt +8 -0
- data/Manifest.txt +11 -0
- data/README.txt +59 -0
- data/Rakefile +32 -0
- data/sfh.rb +2 -0
- metadata +41 -23
- data/README +0 -20
- data/gemspec.rb +0 -32
- data/test_sfh.rb +0 -15
data/History.txt
ADDED
data/Manifest.txt
ADDED
data/README.txt
ADDED
@@ -0,0 +1,59 @@
|
|
1
|
+
sfh
|
2
|
+
by Jonathan Wilkins
|
3
|
+
http://sfh.rubyforge.org
|
4
|
+
|
5
|
+
== DESCRIPTION:
|
6
|
+
SuperFastHash is a hash designed by Paul Hsieh (http://www.azillionmonkeys.com/qed/hash.html).
|
7
|
+
This is just a gem for it.
|
8
|
+
|
9
|
+
== FEATURES/PROBLEMS:
|
10
|
+
* No known issues, let me know if you find any.
|
11
|
+
|
12
|
+
== SYNOPSIS:
|
13
|
+
For inline version
|
14
|
+
require 'sfh'
|
15
|
+
|
16
|
+
h1 = Sfh.new
|
17
|
+
text1 = "The quick brown fox"
|
18
|
+
puts "Text '#{text1}': #{h1.hash(text1, text1.length)}"
|
19
|
+
|
20
|
+
The SWIG version is used like this:
|
21
|
+
require 'sfh'
|
22
|
+
|
23
|
+
text1 = "The quick brown fox"
|
24
|
+
puts "Text '#{text1}': #{Sfh.hash(text1, text1.length)}"
|
25
|
+
|
26
|
+
== REQUIREMENTS:
|
27
|
+
RubyInline
|
28
|
+
|
29
|
+
== INSTALL:
|
30
|
+
|
31
|
+
* sudo gem install sfh
|
32
|
+
|
33
|
+
== LICENSE:
|
34
|
+
|
35
|
+
Gem is under MIT (below), SFH C code is under Paul Hsieh's licence which
|
36
|
+
is in the code.
|
37
|
+
|
38
|
+
(The MIT License)
|
39
|
+
|
40
|
+
Copyright (c) 2008
|
41
|
+
|
42
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
43
|
+
a copy of this software and associated documentation files (the
|
44
|
+
'Software'), to deal in the Software without restriction, including
|
45
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
46
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
47
|
+
permit persons to whom the Software is furnished to do so, subject to
|
48
|
+
the following conditions:
|
49
|
+
|
50
|
+
The above copyright notice and this permission notice shall be
|
51
|
+
included in all copies or substantial portions of the Software.
|
52
|
+
|
53
|
+
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
54
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
55
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
56
|
+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
57
|
+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
58
|
+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
59
|
+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/Rakefile
ADDED
@@ -0,0 +1,32 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'hoe'
|
3
|
+
require './sfh.rb'
|
4
|
+
|
5
|
+
Hoe.new('sfh', Sfh::VERSION) do |p|
|
6
|
+
p.rubyforge_name = 'sfh'
|
7
|
+
p.author = 'Jonathan Wilkins'
|
8
|
+
p.email = 'jwilkins[at]bitland[dot]net'
|
9
|
+
p.summary = 'SuperFastHash is a hash designed by Paul Hsieh ' +
|
10
|
+
'(http://www.azillionmonkeys.com/qed/hash.html). ' +
|
11
|
+
'This is just a gem for it.'
|
12
|
+
p.description = p.paragraphs_of('README.txt', 2..5).join("\n\n")
|
13
|
+
p.url = p.paragraphs_of('README.txt', 0).first.split(/\n/)[1..-1]
|
14
|
+
p.changes = p.paragraphs_of('History.txt', 0..1).join("\n\n")
|
15
|
+
p.extra_deps = ['RubyInline']
|
16
|
+
p.spec_extras = { :extensions => ['ext/extconf.rb'] }
|
17
|
+
end
|
18
|
+
|
19
|
+
Rake::Task[:test].prerequisites << :extension
|
20
|
+
|
21
|
+
kind = Config::CONFIG["DLEXT"]
|
22
|
+
|
23
|
+
desc "Build native version"
|
24
|
+
task :extension => ["ext/sfh.#{kind}"]
|
25
|
+
|
26
|
+
file "ext/Makefile" => "ext/extconf.rb" do
|
27
|
+
Dir.chdir("ext") { ruby "extconf.rb" }
|
28
|
+
end
|
29
|
+
|
30
|
+
file "ext/sfh.#{kind}" => FileList["ext/Makefile", "ext/*.{c,h}"] do
|
31
|
+
Dir.chdir("ext") { sh "make" }
|
32
|
+
end
|
data/sfh.rb
CHANGED
metadata
CHANGED
@@ -3,16 +3,16 @@ rubygems_version: 0.9.4
|
|
3
3
|
specification_version: 1
|
4
4
|
name: sfh
|
5
5
|
version: !ruby/object:Gem::Version
|
6
|
-
version: 1.0.
|
7
|
-
date: 2008-02-
|
8
|
-
summary:
|
6
|
+
version: 1.0.1
|
7
|
+
date: 2008-02-29 00:00:00 -08:00
|
8
|
+
summary: SuperFastHash is a hash designed by Paul Hsieh (http://www.azillionmonkeys.com/qed/hash.html). This is just a gem for it.
|
9
9
|
require_paths:
|
10
|
-
-
|
11
|
-
email: jwilkins[at]
|
12
|
-
homepage:
|
13
|
-
rubyforge_project:
|
14
|
-
description:
|
15
|
-
autorequire:
|
10
|
+
- ext
|
11
|
+
email: jwilkins[at]bitland[dot]net
|
12
|
+
homepage: " by Jonathan Wilkins"
|
13
|
+
rubyforge_project: sfh
|
14
|
+
description: "== FEATURES/PROBLEMS: * No known issues, let me know if you find any. == SYNOPSIS: For inline version require 'sfh' h1 = Sfh.new text1 = \"The quick brown fox\" puts \"Text '#{text1}': #{h1.hash(text1, text1.length)}\" The SWIG version is used like this: require 'sfh'"
|
15
|
+
autorequire:
|
16
16
|
default_executable:
|
17
17
|
bindir: bin
|
18
18
|
has_rdoc: true
|
@@ -29,30 +29,48 @@ post_install_message:
|
|
29
29
|
authors:
|
30
30
|
- Jonathan Wilkins
|
31
31
|
files:
|
32
|
+
- History.txt
|
33
|
+
- Manifest.txt
|
34
|
+
- README.txt
|
35
|
+
- Rakefile
|
32
36
|
- sfh.rb
|
33
|
-
- README
|
34
|
-
- test_sfh.rb
|
35
|
-
- examples
|
36
|
-
- ext
|
37
|
-
- bin
|
38
|
-
- gemspec.rb
|
39
37
|
- bin/sfhsum
|
38
|
+
- ext/extconf.rb
|
40
39
|
- ext/sfh.c
|
41
|
-
- ext/test_sfh_swig.rb
|
42
|
-
- ext/sfh_wrap.c
|
43
40
|
- ext/sfh.i
|
44
|
-
- ext/
|
41
|
+
- ext/sfh_wrap.c
|
42
|
+
- ext/test_sfh_swig.rb
|
45
43
|
test_files: []
|
46
44
|
|
47
|
-
rdoc_options:
|
48
|
-
|
45
|
+
rdoc_options:
|
46
|
+
- --main
|
47
|
+
- README.txt
|
49
48
|
extra_rdoc_files:
|
50
|
-
-
|
49
|
+
- History.txt
|
50
|
+
- Manifest.txt
|
51
|
+
- README.txt
|
51
52
|
executables:
|
52
53
|
- sfhsum
|
53
54
|
extensions:
|
54
55
|
- ext/extconf.rb
|
55
56
|
requirements: []
|
56
57
|
|
57
|
-
dependencies:
|
58
|
-
|
58
|
+
dependencies:
|
59
|
+
- !ruby/object:Gem::Dependency
|
60
|
+
name: RubyInline
|
61
|
+
version_requirement:
|
62
|
+
version_requirements: !ruby/object:Gem::Version::Requirement
|
63
|
+
requirements:
|
64
|
+
- - ">"
|
65
|
+
- !ruby/object:Gem::Version
|
66
|
+
version: 0.0.0
|
67
|
+
version:
|
68
|
+
- !ruby/object:Gem::Dependency
|
69
|
+
name: hoe
|
70
|
+
version_requirement:
|
71
|
+
version_requirements: !ruby/object:Gem::Version::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: 1.5.0
|
76
|
+
version:
|
data/README
DELETED
@@ -1,20 +0,0 @@
|
|
1
|
-
sfh
|
2
|
-
--------
|
3
|
-
SuperFastHash is a hash designed by Paul Hsieh (http://www.azillionmonkeys.com/qed/hash.html).
|
4
|
-
This is just a gem for it.
|
5
|
-
|
6
|
-
Usage is as follows for the inline version:
|
7
|
-
|
8
|
-
require 'sfh'
|
9
|
-
|
10
|
-
h1 = Sfh.new
|
11
|
-
text1 = "The quick brown fox"
|
12
|
-
puts "Text '#{text1}': #{h1.hash(text1, text1.length)}"
|
13
|
-
|
14
|
-
The SWIG version is used like this:
|
15
|
-
require 'sfh'
|
16
|
-
|
17
|
-
text1 = "The quick brown fox"
|
18
|
-
puts "Text '#{text1}': #{Sfh.hash(text1, text1.length)}"
|
19
|
-
|
20
|
-
|
data/gemspec.rb
DELETED
@@ -1,32 +0,0 @@
|
|
1
|
-
require 'rake'
|
2
|
-
require 'mkmf'
|
3
|
-
|
4
|
-
SPEC = Gem::Specification.new do |spec|
|
5
|
-
spec.name = "sfh"
|
6
|
-
spec.version = "1.0.0"
|
7
|
-
spec.summary = "A gem for SuperFastHash (http://www.azillionmonkeys.com/qed/hash.html)"
|
8
|
-
spec.author = "Jonathan Wilkins"
|
9
|
-
spec.email = "jwilkins[at]nospam[dot]bitland[dot]net"
|
10
|
-
spec.has_rdoc = true
|
11
|
-
spec.extra_rdoc_files = ["README"]
|
12
|
-
spec.require_path = "."
|
13
|
-
spec.autorequire = "sfh.rb"
|
14
|
-
|
15
|
-
unfiltered_files = FileList['*', 'examples/*', 'bin/*', 'ext/*']
|
16
|
-
spec.files = unfiltered_files.delete_if do |filename|
|
17
|
-
filename.include?(".gem") || filename.include?("Makefile") ||
|
18
|
-
filename.include?(".so") || filename.include?(".o")
|
19
|
-
end
|
20
|
-
spec.executables = ['sfhsum']
|
21
|
-
|
22
|
-
# optional native component
|
23
|
-
if cc_command
|
24
|
-
spec.extensions << 'ext/extconf.rb'
|
25
|
-
end
|
26
|
-
|
27
|
-
puts "Building gem w/ "
|
28
|
-
spec.files.each do |f|
|
29
|
-
puts "- #{f}"
|
30
|
-
end
|
31
|
-
|
32
|
-
end
|
data/test_sfh.rb
DELETED
@@ -1,15 +0,0 @@
|
|
1
|
-
require 'sfh'
|
2
|
-
|
3
|
-
str = 'asdf'
|
4
|
-
times = 1000000
|
5
|
-
|
6
|
-
h = Sfh.new
|
7
|
-
puts "hashing #{str} #{times} times"
|
8
|
-
times.times { h.hash(str, str.length) }
|
9
|
-
puts "done"
|
10
|
-
|
11
|
-
times = 1000
|
12
|
-
puts "hashing #{str}*1000000 #{times} times"
|
13
|
-
str = str*1000000
|
14
|
-
times.times { h.hash(str, str.length) }
|
15
|
-
puts "done"
|