mirror of
https://github.com/dkam/hsmr.git
synced 2025-12-28 08:44:53 +00:00
Fix bug switching to odd parity
This commit is contained in:
@@ -68,7 +68,7 @@ module HSMR
|
|||||||
end
|
end
|
||||||
|
|
||||||
def set_odd_parity
|
def set_odd_parity
|
||||||
return true if self.odd_parity? == true
|
return self if self.odd_parity? == true
|
||||||
|
|
||||||
working=@key.unpack('H2'*(@key.length))
|
working=@key.unpack('H2'*(@key.length))
|
||||||
working.each_with_index do |o,i|
|
working.each_with_index do |o,i|
|
||||||
@@ -97,6 +97,7 @@ module HSMR
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
@key = working.join.unpack('a2'*(working.length)).map{|x| x.hex}.pack('c'*(working.length))
|
@key = working.join.unpack('a2'*(working.length)).map{|x| x.hex}.pack('c'*(working.length))
|
||||||
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
def xor(other)
|
def xor(other)
|
||||||
|
|||||||
Reference in New Issue
Block a user