diff --git a/Eth.html b/Eth.html index 0ede8aef..3f4c1f1b 100644 --- a/Eth.html +++ b/Eth.html @@ -195,7 +195,7 @@
-146 -147 -148+149 +150 +151
# File 'lib/eth/util.rb', line 146 +# File 'lib/eth/util.rb', line 149 def big_endian_to_int(str) str.unpack("H*").first.to_i(16) @@ -1402,17 +1402,17 @@
-49 -50 51 -52+52 +53 +54
# File 'lib/eth/util.rb', line 49 +# File 'lib/eth/util.rb', line 51 def bin_to_hex(bin) raise TypeError, "Value must be an instance of String" unless bin.instance_of? String - bin.unpack("H*").first + hex = bin.unpack("H*").first end
-89 -90 -91+92 +93 +94
# File 'lib/eth/util.rb', line 89 +# File 'lib/eth/util.rb', line 92 def bin_to_prefixed_hex(bin) prefix_hex bin_to_hex bin @@ -1562,12 +1562,12 @@
-170 -171 -172+173 +174 +175
# File 'lib/eth/util.rb', line 170 +# File 'lib/eth/util.rb', line 173 def bytes?(str) str && str.instance_of?(String) && str.encoding.name == Constant::BINARY_ENCODING @@ -1641,12 +1641,12 @@
-162 -163 -164+165 +166 +167
# File 'lib/eth/util.rb', line 162 +# File 'lib/eth/util.rb', line 165 def bytes_to_str(bin) bin.unpack("U*").pack("U*") @@ -1720,12 +1720,12 @@
-194 -195 -196+197 +198 +199
# File 'lib/eth/util.rb', line 194 +# File 'lib/eth/util.rb', line 197 def ceil32(num) num % 32 == 0 ? num : (num + 32 - num % 32) @@ -1799,12 +1799,12 @@
-138 -139 -140+141 +142 +143
# File 'lib/eth/util.rb', line 138 +# File 'lib/eth/util.rb', line 141 def deserialize_big_endian_to_int(str) Rlp::Sedes.big_endian_int.deserialize str.sub(/\A(\x00)+/, "") @@ -1878,14 +1878,14 @@
-97 -98 -99 100 -101+101 +102 +103 +104
# File 'lib/eth/util.rb', line 97 +# File 'lib/eth/util.rb', line 100 def hex?(str) return false unless str.is_a? String @@ -1979,21 +1979,23 @@
-60 -61 62 63 64 -65+65 +66 +67 +68
# File 'lib/eth/util.rb', line 60 +# File 'lib/eth/util.rb', line 62 def hex_to_bin(hex) raise TypeError, "Value must be an instance of String" unless hex.instance_of? String hex = remove_hex_prefix hex raise TypeError, "Non-hexadecimal digit found" unless hex? hex - [hex].pack("H*") + hex = "0#{hex}" if hex.size % 2 != 0 + bin = [hex].pack("H*") end
-128 -129 -130 131 -132+132 +133 +134 +135
# File 'lib/eth/util.rb', line 128 +# File 'lib/eth/util.rb', line 131 def int_to_big_endian(num) hex = num.to_s(16) unless hex? num @@ -2147,12 +2149,12 @@
-40 -41 -42+42 +43 +44
# File 'lib/eth/util.rb', line 40 +# File 'lib/eth/util.rb', line 42 def keccak256(str) Digest::Keccak.new(256).digest str @@ -2226,12 +2228,12 @@
-186 -187 -188+189 +190 +191
# File 'lib/eth/util.rb', line 186 +# File 'lib/eth/util.rb', line 189 def list?(item) !primitive?(item) && item.respond_to?(:each) @@ -2337,13 +2339,13 @@
-204 -205 -206 -207+207 +208 +209 +210
# File 'lib/eth/util.rb', line 204 +# File 'lib/eth/util.rb', line 207 def lpad(str, sym, len) return str if str.size >= len @@ -2418,13 +2420,13 @@
-71 -72 -73 -74+74 +75 +76 +77
# File 'lib/eth/util.rb', line 71 +# File 'lib/eth/util.rb', line 74 def prefix_hex(hex) return hex if prefixed? hex @@ -2499,12 +2501,12 @@
-107 -108 -109+110 +111 +112
# File 'lib/eth/util.rb', line 107 +# File 'lib/eth/util.rb', line 110 def prefixed?(hex) hex.match /\A0x/ @@ -2578,12 +2580,12 @@
-178 -179 -180+181 +182 +183
# File 'lib/eth/util.rb', line 178 +# File 'lib/eth/util.rb', line 181 def primitive?(item) item.instance_of?(String) @@ -2657,15 +2659,15 @@
-29 -30 31 32 33 -34+34 +35 +36
# File 'lib/eth/util.rb', line 29 +# File 'lib/eth/util.rb', line 31 def public_key_to_address(str) str = hex_to_bin str if hex? str @@ -2742,13 +2744,13 @@
-80 -81 -82 -83+83 +84 +85 +86
# File 'lib/eth/util.rb', line 80 +# File 'lib/eth/util.rb', line 83 def remove_hex_prefix(hex) return hex[2..-1] if prefixed? hex @@ -2841,16 +2843,16 @@
-116 -117 -118 119 120 121 -122+122 +123 +124 +125
# File 'lib/eth/util.rb', line 116 +# File 'lib/eth/util.rb', line 119 def serialize_int_to_big_endian(num) num = num.to_i(16) if hex? num @@ -2928,12 +2930,12 @@
-154 -155 -156+157 +158 +159
# File 'lib/eth/util.rb', line 154 +# File 'lib/eth/util.rb', line 157 def str_to_bytes(str) bytes?(str) ? str : str.b @@ -3023,12 +3025,12 @@
-214 -215 -216+217 +218 +219
# File 'lib/eth/util.rb', line 214 +# File 'lib/eth/util.rb', line 217 def zpad(str, len) lpad str, Constant::BYTE_ZERO, len @@ -3120,12 +3122,12 @@
-223 -224 -225+226 +227 +228
# File 'lib/eth/util.rb', line 223 +# File 'lib/eth/util.rb', line 226 def zpad_hex(hex, len = 32) zpad hex_to_bin(hex), len @@ -3217,12 +3219,12 @@
-232 -233 -234+235 +236 +237
# File 'lib/eth/util.rb', line 232 +# File 'lib/eth/util.rb', line 235 def zpad_int(num, len = 32) zpad serialize_int_to_big_endian(num), len @@ -3302,12 +3304,12 @@
-146 -147 -148+149 +150 +151
# File 'lib/eth/util.rb', line 146 +# File 'lib/eth/util.rb', line 149 def big_endian_to_int(str) str.unpack("H*").first.to_i(16) @@ -3399,17 +3401,17 @@
-49 -50 51 -52+52 +53 +54
# File 'lib/eth/util.rb', line 49 +# File 'lib/eth/util.rb', line 51 def bin_to_hex(bin) raise TypeError, "Value must be an instance of String" unless bin.instance_of? String - bin.unpack("H*").first + hex = bin.unpack("H*").first end
-89 -90 -91+92 +93 +94
# File 'lib/eth/util.rb', line 89 +# File 'lib/eth/util.rb', line 92 def bin_to_prefixed_hex(bin) prefix_hex bin_to_hex bin @@ -3559,12 +3561,12 @@
-170 -171 -172+173 +174 +175
# File 'lib/eth/util.rb', line 170 +# File 'lib/eth/util.rb', line 173 def bytes?(str) str && str.instance_of?(String) && str.encoding.name == Constant::BINARY_ENCODING @@ -3638,12 +3640,12 @@
-162 -163 -164+165 +166 +167
# File 'lib/eth/util.rb', line 162 +# File 'lib/eth/util.rb', line 165 def bytes_to_str(bin) bin.unpack("U*").pack("U*") @@ -3717,12 +3719,12 @@
-194 -195 -196+197 +198 +199
# File 'lib/eth/util.rb', line 194 +# File 'lib/eth/util.rb', line 197 def ceil32(num) num % 32 == 0 ? num : (num + 32 - num % 32) @@ -3796,12 +3798,12 @@
-138 -139 -140+141 +142 +143
# File 'lib/eth/util.rb', line 138 +# File 'lib/eth/util.rb', line 141 def deserialize_big_endian_to_int(str) Rlp::Sedes.big_endian_int.deserialize str.sub(/\A(\x00)+/, "") @@ -3875,14 +3877,14 @@
-97 -98 -99 100 -101+101 +102 +103 +104
# File 'lib/eth/util.rb', line 97 +# File 'lib/eth/util.rb', line 100 def hex?(str) return false unless str.is_a? String @@ -3976,21 +3978,23 @@
-60 -61 62 63 64 -65+65 +66 +67 +68
# File 'lib/eth/util.rb', line 60 +# File 'lib/eth/util.rb', line 62 def hex_to_bin(hex) raise TypeError, "Value must be an instance of String" unless hex.instance_of? String hex = remove_hex_prefix hex raise TypeError, "Non-hexadecimal digit found" unless hex? hex - [hex].pack("H*") + hex = "0#{hex}" if hex.size % 2 != 0 + bin = [hex].pack("H*") end
-128 -129 -130 131 -132+132 +133 +134 +135
# File 'lib/eth/util.rb', line 128 +# File 'lib/eth/util.rb', line 131 def int_to_big_endian(num) hex = num.to_s(16) unless hex? num @@ -4144,12 +4148,12 @@
-40 -41 -42+42 +43 +44
# File 'lib/eth/util.rb', line 40 +# File 'lib/eth/util.rb', line 42 def keccak256(str) Digest::Keccak.new(256).digest str @@ -4223,12 +4227,12 @@
-186 -187 -188+189 +190 +191
# File 'lib/eth/util.rb', line 186 +# File 'lib/eth/util.rb', line 189 def list?(item) !primitive?(item) && item.respond_to?(:each) @@ -4334,13 +4338,13 @@
-204 -205 -206 -207+207 +208 +209 +210
# File 'lib/eth/util.rb', line 204 +# File 'lib/eth/util.rb', line 207 def lpad(str, sym, len) return str if str.size >= len @@ -4415,13 +4419,13 @@
-71 -72 -73 -74+74 +75 +76 +77
# File 'lib/eth/util.rb', line 71 +# File 'lib/eth/util.rb', line 74 def prefix_hex(hex) return hex if prefixed? hex @@ -4496,12 +4500,12 @@
-107 -108 -109+110 +111 +112
# File 'lib/eth/util.rb', line 107 +# File 'lib/eth/util.rb', line 110 def prefixed?(hex) hex.match /\A0x/ @@ -4575,12 +4579,12 @@
-178 -179 -180+181 +182 +183
# File 'lib/eth/util.rb', line 178 +# File 'lib/eth/util.rb', line 181 def primitive?(item) item.instance_of?(String) @@ -4654,15 +4658,15 @@
-29 -30 31 32 33 -34+34 +35 +36
# File 'lib/eth/util.rb', line 29 +# File 'lib/eth/util.rb', line 31 def public_key_to_address(str) str = hex_to_bin str if hex? str @@ -4739,13 +4743,13 @@
-80 -81 -82 -83+83 +84 +85 +86
# File 'lib/eth/util.rb', line 80 +# File 'lib/eth/util.rb', line 83 def remove_hex_prefix(hex) return hex[2..-1] if prefixed? hex @@ -4838,16 +4842,16 @@
-116 -117 -118 119 120 121 -122+122 +123 +124 +125
# File 'lib/eth/util.rb', line 116 +# File 'lib/eth/util.rb', line 119 def serialize_int_to_big_endian(num) num = num.to_i(16) if hex? num @@ -4925,12 +4929,12 @@
-154 -155 -156+157 +158 +159
# File 'lib/eth/util.rb', line 154 +# File 'lib/eth/util.rb', line 157 def str_to_bytes(str) bytes?(str) ? str : str.b @@ -5020,12 +5024,12 @@
-214 -215 -216+217 +218 +219
# File 'lib/eth/util.rb', line 214 +# File 'lib/eth/util.rb', line 217 def zpad(str, len) lpad str, Constant::BYTE_ZERO, len @@ -5117,12 +5121,12 @@
-223 -224 -225+226 +227 +228
# File 'lib/eth/util.rb', line 223 +# File 'lib/eth/util.rb', line 226 def zpad_hex(hex, len = 32) zpad hex_to_bin(hex), len @@ -5214,12 +5218,12 @@
-232 -233 -234+235 +236 +237
# File 'lib/eth/util.rb', line 232 +# File 'lib/eth/util.rb', line 235 def zpad_int(num, len = 32) zpad serialize_int_to_big_endian(num), len @@ -5234,7 +5238,7 @@diff --git a/_index.html b/_index.html index 6d4c6290..aa1930a2 100644 --- a/_index.html +++ b/_index.html @@ -657,7 +657,7 @@
Namespace Listing A-Z
diff --git a/file.README.html b/file.README.html index 86845eab..ebe07099 100644 --- a/file.README.html +++ b/file.README.html @@ -131,7 +131,7 @@License and Credits
diff --git a/index.html b/index.html index 22fc0d93..8a60f32f 100644 --- a/index.html +++ b/index.html @@ -131,7 +131,7 @@License and Credits
diff --git a/top-level-namespace.html b/top-level-namespace.html index d0883d7e..f57c194c 100644 --- a/top-level-namespace.html +++ b/top-level-namespace.html @@ -100,7 +100,7 @@Defined Under Namespace