lib/bencoding/hash.rb in simonmenke-bencoding-0.0.1 vs lib/bencoding/hash.rb in simonmenke-bencoding-0.0.2
- old
+ new
@@ -1,10 +1,10 @@
module Bencoding
module Hash
def to_bencoding
- "d"+sort.collect{|key, item|key.to_bencoding+item.to_bencoding}.join+"e"
+ "d"+sort{|a,b|a[0].to_s<=>b[0].to_s}.collect{|key, item|key.to_bencoding+item.to_bencoding}.join+"e"
end
end
end