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

Method digest_utf8_array_impl

datafusion/functions/src/crypto/basic.rs:124–153  ·  view source on GitHub ↗
(
        self,
        input_value: &StringArrType,
    )

Source from the content-addressed store, hash-verified

122 }
123
124 fn digest_utf8_array_impl<'a, StringArrType>(
125 self,
126 input_value: &StringArrType,
127 ) -> ArrayRef
128 where
129 StringArrType: StringArrayType<'a>,
130 {
131 match self {
132 Self::Md5 => digest_to_array!(md5, Md5, input_value),
133 Self::Sha224 => digest_to_array!(sha2, Sha224, input_value),
134 Self::Sha256 => digest_to_array!(sha2, Sha256, input_value),
135 Self::Sha384 => digest_to_array!(sha2, Sha384, input_value),
136 Self::Sha512 => digest_to_array!(sha2, Sha512, input_value),
137 Self::Blake2b => digest_to_array!(blake2, Blake2b512, input_value),
138 Self::Blake2s => digest_to_array!(blake2, Blake2s256, input_value),
139 Self::Blake3 => {
140 let binary_array: BinaryArray = input_value
141 .iter()
142 .map(|opt| {
143 opt.map(|x| {
144 let mut digest = Blake3::default();
145 digest.update(x.as_bytes());
146 Blake3::finalize(&digest).as_bytes().to_vec()
147 })
148 })
149 .collect();
150 Arc::new(binary_array)
151 }
152 }
153 }
154
155 fn digest_binary_array_impl<'a, BinaryArrType>(
156 self,

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