-
Notifications
You must be signed in to change notification settings - Fork 109
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Set
String
encodings in SecureRandom
trampoline
All `String`s returned by `SecureRandom` methods are either ASCII or Binary, so set the encoding to reflect this. This means we now pass some additional tests in ruby/spec since the random bytes we are returning now properly yield their length as their bytesize. Prior to #1222, `String#length` always assumed UTF-8, which means if the binary content returned by `SecureRandom` happened to have a multi-byte UTF-8 character, the `length` would be shorter than expected.
- Loading branch information
Showing
3 changed files
with
13 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters