Feature #4042
closedString#crypt shoud not accepted "\x00" as a salt.
Description
=begin
I noticed if the salt contains non ascii value, the result is platform dependant.
Especially, the salt start with "\x00", the result is empty string on Linux.
On Linux,
ruby 1.9.3dev (2010-11-04 trunk 29682) [i686-linux]
irb(main):001:0> "foo".crypt("\x00\x00")
=> ""
irb(main):002:0> "foo".crypt("\x00\x01")
=> ""
irb(main):003:0> "foo".crypt("\x01\x00")
=> "\x01\x01Rqd3mnMHSeY"
irb(main):004:0> "foo".crypt("\x01\x01")
=> "\x01\x01EV3MX6qznTs"
irb(main):005:0> "foo".crypt("ab")
=> "abQ9KY.KfrYrc"
On Windows,
ruby 1.9.3dev (2010-11-09 trunk 29737) [i386-mswin32_90]
irb(main):001:0> "foo".crypt("\x00\x00")
=> "..XXIp7/c78Qo"
irb(main):002:0> "foo".crypt("\x00\x01")
=> ".\x01XXIp7/c78Qo"
irb(main):003:0> "foo".crypt("\x01\x00")
=> "\x01.XXIp7/c78Qo"
irb(main):004:0> "foo".crypt("\x01\x01")
=> "\x01\x01XXIp7/c78Qo"
irb(main):005:0> "foo".crypt('ab')
=> "abQ9KY.KfrYrc"
I think that String#crypt shoud raise ArgError if "\x00" used as a salt.
=end