cbor-canonical 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: 6373c6f0c54a80637fe4ad443a4a59fed8c26eb3
4
- data.tar.gz: 930c8fe482a53f761603af7ecb7153377ecdc07a
3
+ metadata.gz: ab062f791bce0e81297faecdc9ce7b1c262691de
4
+ data.tar.gz: 6366480206eba1c826dafbeec27127d18e9d5bda
5
5
  SHA512:
6
- metadata.gz: 08242d8d1c8d57c1ef12470e41cd08ad359567fd529a8fe16488bbae540d898d0fc5b3bed58de8b34cd406e0701d9393254accb48821586e0a60150e1277d9ad
7
- data.tar.gz: 8ac5a29219b1624e059cfadcafcfda7b2179a3dbbb1e99247764b7859a7704b6aadc5d284ee527decec61cc49a81ad5aee8be87d0ea4f49df228be146172ecd9
6
+ metadata.gz: b1be468685e551d3f557a08f85f6afd3dd2e5fe7a866df7744c0186a20d733309795c2f937d8682eeabb33286fb110c9742b87f5fc31d34c345727f1cbd8d57b
7
+ data.tar.gz: c88d13767f70598fffb1fbdec87cf64f94b685bf0f0c53ea299aea0d5a4f49454e7c2f696c04db51a933da372900e1e9eac21ec715702433af39137b30c1e5e6
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "cbor-canonical"
3
- s.version = "0.1.0"
3
+ s.version = "0.1.1"
4
4
  s.summary = "CBOR (Concise Binary Object Representation) canonical encoding"
5
5
  s.description = %q{cbor-canonical implements canonical encoding for CBOR, RFC 7049 Section 3.9}
6
6
  s.author = "Carsten Bormann"
@@ -24,8 +24,11 @@ module CBOR
24
24
 
25
25
  module Hash_Canonical_CBOR
26
26
  def cbor_pre_canonicalize
27
- Hash[map {|k, v| cc = k.to_canonical_cbor
28
- [cc.size, cc, k, v]}.
27
+ Hash[map {|k, v|
28
+ k = k.cbor_pre_canonicalize
29
+ v = v.cbor_pre_canonicalize
30
+ cc = k.to_cbor # already canonical
31
+ [cc.size, cc, k, v]}.
29
32
  sort.map{|s, cc, k, v| [k, v]}]
30
33
  end
31
34
  end
@@ -3,6 +3,7 @@ require 'cbor-canonical'
3
3
  [[1], [false], [10.3], [10.5], [Float::NAN],
4
4
  [{a: 1, b: [1, 2]}],
5
5
  [{aa: 1, b: 2}, {b: 2, aa: 1}],
6
+ [{aa: 1, b: {mm: 2, m: 3}}, {b: {m: 3, mm: 2}, aa: 1}],
6
7
  [CBOR::Tagged.new(4711, {aa: 1, b: 2}),
7
8
  CBOR::Tagged.new(4711, {b: 2, aa: 1})],
8
9
  ].each do |ex1, ex2, ex3|
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cbor-canonical
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
  - Carsten Bormann