-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added OpenSSL::Cipher Documentation #9934
Conversation
src/openssl/cipher.cr
Outdated
@@ -1,6 +1,41 @@ | |||
require "random/secure" | |||
require "openssl" | |||
|
|||
# A class which can be used to encrypt and decrypt string data using a specified cipher. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not only for string, is it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry I wasn't sure what is allowed for input into OpenSSL::Cipher#update
. I'm guessing it's anything that can be turned into Bytes
, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah the only technical requirement seems to be having a #to_slice
method. The practical idea is obviously to allow String | Bytes
. Maybe that should be added as a type restriction to communicate this clearly. This would prevent you from passing any other type that implements #to_slice
but that's not common and you can just convert it to a slice at the callsite.
Co-authored-by: Sijawusz Pur Rahnama <[email protected]>
Co-authored-by: Johannes Müller <[email protected]>
https://crystal-lang.org/api/0.35.1/OpenSSL/Cipher.html
There's no docs so I added them. Let me know if I need to be clearer.