datafusion_functions/crypto/
mod.rs1use datafusion_expr::ScalarUDF;
21use std::sync::Arc;
22
23pub mod basic;
24pub mod digest;
25pub mod md5;
26pub mod sha224;
27pub mod sha256;
28pub mod sha384;
29pub mod sha512;
30make_udf_function!(digest::DigestFunc, digest);
31make_udf_function!(md5::Md5Func, md5);
32make_udf_function!(sha224::SHA224Func, sha224);
33make_udf_function!(sha256::SHA256Func, sha256);
34make_udf_function!(sha384::SHA384Func, sha384);
35make_udf_function!(sha512::SHA512Func, sha512);
36
37pub mod expr_fn {
38 export_functions!((
39 digest,
40 "Computes the binary hash of an expression using the specified algorithm.",
41 input_arg1 input_arg2
42 ),(
43 md5,
44 "Computes an MD5 128-bit checksum for a string expression.",
45 input_arg
46 ),(
47 sha224,
48 "Computes the SHA-224 hash of a binary string.",
49 input_arg1
50 ),(
51 sha256,
52 "Computes the SHA-256 hash of a binary string.",
53 input_arg1
54 ),(
55 sha384,
56 "Computes the SHA-384 hash of a binary string.",
57 input_arg1
58 ),(
59 sha512,
60 "Computes the SHA-512 hash of a binary string.",
61 input_arg1
62 ));
63}
64
65pub fn functions() -> Vec<Arc<ScalarUDF>> {
67 vec![digest(), md5(), sha224(), sha256(), sha384(), sha512()]
68}