MCPcopy Create free account
hub / github.com/apache/datafusion / digest_binary_array_impl

Method digest_binary_array_impl

datafusion/functions/src/crypto/basic.rs:155–184  ·  view source on GitHub ↗
(
        self,
        input_value: &BinaryArrType,
    )

Source from the content-addressed store, hash-verified

153 }
154
155 fn digest_binary_array_impl<'a, BinaryArrType>(
156 self,
157 input_value: &BinaryArrType,
158 ) -> ArrayRef
159 where
160 BinaryArrType: BinaryArrayType<'a>,
161 {
162 match self {
163 Self::Md5 => digest_to_array!(md5, Md5, input_value),
164 Self::Sha224 => digest_to_array!(sha2, Sha224, input_value),
165 Self::Sha256 => digest_to_array!(sha2, Sha256, input_value),
166 Self::Sha384 => digest_to_array!(sha2, Sha384, input_value),
167 Self::Sha512 => digest_to_array!(sha2, Sha512, input_value),
168 Self::Blake2b => digest_to_array!(blake2, Blake2b512, input_value),
169 Self::Blake2s => digest_to_array!(blake2, Blake2s256, input_value),
170 Self::Blake3 => {
171 let binary_array: BinaryArray = input_value
172 .iter()
173 .map(|opt| {
174 opt.map(|x| {
175 let mut digest = Blake3::default();
176 digest.update(x);
177 Blake3::finalize(&digest).as_bytes().to_vec()
178 })
179 })
180 .collect();
181 Arc::new(binary_array)
182 }
183 }
184 }
185}
186
187pub(crate) fn digest_process(

Callers 1

digest_processFunction · 0.80

Calls 6

newFunction · 0.85
collectMethod · 0.80
to_vecMethod · 0.80
mapMethod · 0.45
iterMethod · 0.45
updateMethod · 0.45

Tested by

no test coverage detected