murky_waters 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +4 -0
- data/lib/murky.rb +1 -0
- data/lib/murky/dict.rb +9 -1
- data/lib/murky/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d06965868947c541b92ef696bf36e027630a0f91
|
4
|
+
data.tar.gz: d696682c67078e576b57e3c33bd07148eff09a4f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bcba143fd8bf630e3cc3b4ef894056000615e341bbd19d79d58387c5a00a7f8f88123a89d3269b6103d9748dae86b2e03951e8161a82c6774b86c28ea44dabf4
|
7
|
+
data.tar.gz: 7e8a69c51f95a49147ed381944bdd6a22b60b8cfc94be10d664bbc2c37bd9b1c6a0d4efecb0e5489028805c2363449459b315a1c2ef48b840cac613d17d482e4
|
data/README.md
CHANGED
@@ -1,5 +1,9 @@
|
|
1
1
|
# MurkyWaters
|
2
2
|
|
3
|
+
[![Murky Waters](https://img.shields.io/badge/Murky%20Waters--green.svg)](https://github.com/wouterken/murky_waters)
|
4
|
+
[![Gem Version](https://badge.fury.io/rb/murky_waters.svg)](http://badge.fury.io/rb/murky_waters)
|
5
|
+
[![Downloads](https://img.shields.io/gem/dt/murky_waters/stable.svg)](https://img.shields.io/gem/dt/murky_waters)
|
6
|
+
|
3
7
|
MurkyWaters is a simple implementation of a merkle tree backed dictionary.
|
4
8
|
|
5
9
|
You can use this as an you would any ordinary dictionary structure with the added functionality
|
data/lib/murky.rb
CHANGED
data/lib/murky/dict.rb
CHANGED
@@ -9,6 +9,14 @@ module Murky
|
|
9
9
|
define_singleton_method(:data, ->{data})
|
10
10
|
end
|
11
11
|
|
12
|
+
def ==(other)
|
13
|
+
other.respond_to?(:data) && data == other.data
|
14
|
+
end
|
15
|
+
|
16
|
+
def size
|
17
|
+
data.size
|
18
|
+
end
|
19
|
+
|
12
20
|
def keys
|
13
21
|
data.keys
|
14
22
|
end
|
@@ -22,7 +30,7 @@ module Murky
|
|
22
30
|
end
|
23
31
|
|
24
32
|
def height
|
25
|
-
Math.
|
33
|
+
Math.log(size, 2).ceil
|
26
34
|
end
|
27
35
|
|
28
36
|
def sign(value)
|
data/lib/murky/version.rb
CHANGED