-
Notifications
You must be signed in to change notification settings - Fork 1.9k
minor: remove unused crypto functions & narrow public API #20045
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
base: main
Are you sure you want to change the base?
Conversation
| macro_rules! define_digest_function { | ||
| ($NAME: ident, $METHOD: ident, $DOC: expr) => { | ||
| #[doc = $DOC] | ||
| pub fn $NAME(args: &[ColumnarValue]) -> Result<ColumnarValue> { | ||
| let [data] = take_function_args(&DigestAlgorithm::$METHOD.to_string(), args)?; | ||
| digest_process(data, DigestAlgorithm::$METHOD) | ||
| } | ||
| }; | ||
| } | ||
| define_digest_function!( | ||
| sha224, | ||
| Sha224, | ||
| "computes sha224 hash digest of the given input" | ||
| ); |
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.
These are unused but part of our public API; I don't see a good reason to have them exposed so removed them
|
|
||
| #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] | ||
| pub enum DigestAlgorithm { | ||
| pub(crate) enum DigestAlgorithm { |
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.
Removed from public API
| } | ||
|
|
||
| /// computes md5 hash digest of the given input | ||
| pub fn md5(args: &[ColumnarValue]) -> Result<ColumnarValue> { |
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.
Removed from public API, also moved to md5 file which is the only place its used
| } | ||
|
|
||
| pub fn digest_process( | ||
| pub(crate) fn digest_process( |
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.
Removed from public API
Which issue does this PR close?
N/A
Rationale for this change
Removing dead code and remove functions from public API.
What changes are included in this PR?
See comments.
Are these changes tested?
Existing tests.
Are there any user-facing changes?
Yes, some functions removed from public API, but they likely weren't intended to be in our public API.