Skip to content

Commit

Permalink
Replace all instance of 'BINARY' with Encoding::BINARY
Browse files Browse the repository at this point in the history
  • Loading branch information
jcmfernandes committed Feb 13, 2024
1 parent aae5ea4 commit b86bbea
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/rack/session/encryptor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ def initialize(secret, opts = {})
serialize_json: false, pad_size: 32, purpose: nil
}.update(opts)

@hmac_secret = secret.dup.force_encoding('BINARY')
@hmac_secret = secret.dup.force_encoding(Encoding::BINARY)
@cipher_secret = @hmac_secret.slice!(0, 32)

@hmac_secret.freeze
Expand Down Expand Up @@ -250,7 +250,7 @@ def initialize(secret, opts = {})
}.update(opts)
@options[:serialize_json] = true # Enforce JSON serialization

@cipher_secret = secret.dup.force_encoding('BINARY').slice!(0, 32)
@cipher_secret = secret.dup.force_encoding(Encoding::BINARY).slice!(0, 32)
@cipher_secret.freeze
end

Expand Down

0 comments on commit b86bbea

Please sign in to comment.