diff --git a/spec/bcrypt/engine_spec.rb b/spec/bcrypt/engine_spec.rb index cde842c..1660d84 100644 --- a/spec/bcrypt/engine_spec.rb +++ b/spec/bcrypt/engine_spec.rb @@ -66,6 +66,10 @@ class MyInvalidSecret expect(BCrypt::Engine.hash_secret(false, @salt)).to eq BCrypt::Engine.hash_secret("false", @salt) end + specify "should work with different encodings" do + expect(BCrypt::Engine.hash_secret("\xff\xff\xa3".force_encoding('ISO-8859-1'), "$2x$05$/OK.fbVrR/bpIqNJ5ianF.")).to eq "$2x$05$/OK.fbVrR/bpIqNJ5ianF.CE5elHaaO4EbggVDjb8P19RukzXSM3e" + end + specify "should be interoperable with other implementations" do test_vectors = [ # test vectors from the OpenWall implementation , found in wrapper.c