Permalink
Browse files

fixed name, added to readme

  • Loading branch information...
1 parent 88975ad commit 416df905e574c94325abaed6651b94c26ece7921 @mceachen mceachen committed Jan 18, 2012
Showing with 34 additions and 3 deletions.
  1. +1 −1 Gemfile.lock
  2. +32 −1 README.md
  3. +1 −1 bitarray.gemspec
  4. 0 lib/{bit_array.rb → bitarray.rb}
View
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
- bitarray (0.0.4)
+ bitarray (0.0.5)
GEM
remote: http://rubygems.org/
View
@@ -1,3 +1,34 @@
# BitArray: A fast(ish), pure Ruby bit field "type"
-This is a simple rubygem wrapper for the class written by Peter Cooper and posted to dzone.
+This is a simple rubygem wrapper for the class written by Peter Cooper and posted to dzone.
+
+## History
+v5 (added support for flags being on by default, instead of off)
+# v4 (fixed bug where setting 0 bits to 0 caused a set to 1)
+# v3 (supports dynamic bitwidths for array elements.. now doing 32 bit widths default)
+# v2 (now uses 1 << y, rather than 2 ** y .. it's 21.8 times faster!)
+# v1 (first release)
+#
+# Description
+Basic, pure Ruby bit array. Pretty fast (for what it is) and memory efficient.
+Works well for Bloom filters (the reason I wrote it).
+
+Create a bit array 1000 bits wide
+```ruby ba = BitArray.new(1000)```
+
+Setting and reading bits
+```ruby
+ ba[100] = 1
+ ba[100] .. => 1
+ ba[100] = 0
+```
+
+More
+```ruby
+ ba = BitArray.new(20)
+ [1,3,5,9,11,13,15].each { |i| ba[i] = 1 }
+ ba.to_s
+ #=> "01010100010101010000"
+ ba.total_set
+ #=> 7
+```
View
@@ -1,6 +1,6 @@
# -*- encoding: utf-8 -*-
$:.push File.expand_path("../lib", __FILE__)
-require "bit_array"
+require "bitarray"
Gem::Specification.new do |s|
s.name = "bitarray"
File renamed without changes.

0 comments on commit 416df90

Please sign in to comment.