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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: de7e1e125358b97341f115548b95ca34ab2ebc55
4
- data.tar.gz: 840f25e5a769c54375602c0fe4f57963f74136ca
3
+ metadata.gz: d06965868947c541b92ef696bf36e027630a0f91
4
+ data.tar.gz: d696682c67078e576b57e3c33bd07148eff09a4f
5
5
  SHA512:
6
- metadata.gz: c96dcc782f362b34e515310fffd874e4bf6003f839f8f4e291f438583d3e4c739f7dec22b774475f12d455a8eb03c3c51110e9e63458634628875d24716e4d44
7
- data.tar.gz: 639cba30e0f6060d756a7a0040fdf6adec676cbbee08f7cdd5e253fd13afd102ef50d44f9c226fc26ecc39f3b3726d1eb4d1ab4bc1d205215304dd72b2897a88
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
@@ -2,6 +2,7 @@ require 'murky/version'
2
2
  require 'murky/dict'
3
3
  require 'murky/proof'
4
4
  require 'base64'
5
+ require 'openssl'
5
6
 
6
7
  module Murky
7
8
  module_function
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.ceil(Math.log(@size, 2))
33
+ Math.log(size, 2).ceil
26
34
  end
27
35
 
28
36
  def sign(value)
data/lib/murky/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Murky
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: murky_waters
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Wouter Coppieters