exonum-client-ruby 0.0.5 → 0.1.0
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.
- checksums.yaml +4 -4
- data/lib/exonum/types/primitive.rb +3 -0
- data/lib/exonum/version.rb +1 -1
- data/spec/serialization_spec.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fc0a8cc0ca850e50251b0305eddddabac41ad4bfd439de896bc0a8cbda174fb3
|
4
|
+
data.tar.gz: a5fee5bd3bfbfc157f205274fb78ff723e3a0ffb2e02760938546e06b71f4d9d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7d6bef7c5d4af9060dbedf98ac33d1ad57eb0347a83ec99ab6fef6bd1ade34e9544568dde3062b3ff1186e5a5b2308fa142217080cc2e612ca9561fa51f3a81e
|
7
|
+
data.tar.gz: 96f199874b94e93c9b3ca447c8bb380c2e54147271d471f982ca9b3d864ea40fed549a3bcd03a8eaad35de1e42e4f2099f7d59dcdc29b01cf67b3714ff5cee16
|
@@ -11,6 +11,7 @@ module Exonum
|
|
11
11
|
MAX_UINT16 = 65535
|
12
12
|
MAX_UINT32 = 4294967295
|
13
13
|
MAX_UINT64 = 18446744073709551615
|
14
|
+
FLOAT_PRECISION_MULTIPLIER = 10.0 ** 6
|
14
15
|
|
15
16
|
class Int8T
|
16
17
|
def self.size
|
@@ -164,6 +165,7 @@ module Exonum
|
|
164
165
|
end
|
165
166
|
|
166
167
|
def self.serialize value, buffer, from, shift=0
|
168
|
+
value = (value * FLOAT_PRECISION_MULTIPLIER).round / FLOAT_PRECISION_MULTIPLIER
|
167
169
|
[value].pack('e').bytes.each do |byte|
|
168
170
|
buffer[from] = byte
|
169
171
|
from += 1
|
@@ -181,6 +183,7 @@ module Exonum
|
|
181
183
|
end
|
182
184
|
|
183
185
|
def self.serialize value, buffer, from, shift=0
|
186
|
+
value = (value * FLOAT_PRECISION_MULTIPLIER).round / FLOAT_PRECISION_MULTIPLIER
|
184
187
|
[value].pack('E').bytes.each do |byte|
|
185
188
|
buffer[from] = byte
|
186
189
|
from += 1
|
data/lib/exonum/version.rb
CHANGED
data/spec/serialization_spec.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: exonum-client-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yuri Gomozov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-08-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ed25519
|
@@ -108,7 +108,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
108
108
|
version: '0'
|
109
109
|
requirements: []
|
110
110
|
rubyforge_project:
|
111
|
-
rubygems_version: 2.7.
|
111
|
+
rubygems_version: 2.7.7
|
112
112
|
signing_key:
|
113
113
|
specification_version: 4
|
114
114
|
summary: Exonum light clent written in Ruby
|