lib/universa/keys.rb in universa-3.11.4.3 vs lib/universa/keys.rb in universa-3.11.4.4
- old
+ new
@@ -156,13 +156,11 @@
end
# returns binary representation. It is not a string representation!
# @return [String] binary string representation
def packed
- s = get_packed
- s.force_encoding 'binary'
- s
+ @packed ||= get_packed.force_encoding 'binary'
end
# Compare KeyAddress with another KeyAddress or its string or even binary representation.
# Analyzes string length to select proper strategy.
def == other
@@ -178,9 +176,17 @@
to_s == other
end
else
false
end
+ end
+
+ def hash
+ to_s.hash
+ end
+
+ def eql?(other)
+ self == other
end
end
end