Skip to content

Commit 63fa645

Browse files
zecakehjplatte
authored andcommitted
fix(indexeddb): Fix implementation of SafeEncode for tuple of 5 elements
Regression introduced by merging commit 9707d73 after efdeba7 Signed-off-by: Kévin Commaille <[email protected]>
1 parent 0d4fac5 commit 63fa645

File tree

1 file changed

+10
-20
lines changed

1 file changed

+10
-20
lines changed

crates/matrix-sdk-indexeddb/src/safe_encode.rs

Lines changed: 10 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -230,30 +230,20 @@ where
230230

231231
fn as_secure_string(&self, table_name: &str, store_cipher: &StoreCipher) -> String {
232232
[
233-
&base64_encode(
234-
store_cipher.hash_key(table_name, self.0.as_encoded_string().as_bytes()),
235-
&STANDARD_NO_PAD,
236-
),
233+
&STANDARD_NO_PAD
234+
.encode(store_cipher.hash_key(table_name, self.0.as_encoded_string().as_bytes())),
237235
KEY_SEPARATOR,
238-
&base64_encode(
239-
store_cipher.hash_key(table_name, self.1.as_encoded_string().as_bytes()),
240-
&STANDARD_NO_PAD,
241-
),
236+
&STANDARD_NO_PAD
237+
.encode(store_cipher.hash_key(table_name, self.1.as_encoded_string().as_bytes())),
242238
KEY_SEPARATOR,
243-
&base64_encode(
244-
store_cipher.hash_key(table_name, self.2.as_encoded_string().as_bytes()),
245-
&STANDARD_NO_PAD,
246-
),
239+
&STANDARD_NO_PAD
240+
.encode(store_cipher.hash_key(table_name, self.2.as_encoded_string().as_bytes())),
247241
KEY_SEPARATOR,
248-
&base64_encode(
249-
store_cipher.hash_key(table_name, self.3.as_encoded_string().as_bytes()),
250-
&STANDARD_NO_PAD,
251-
),
242+
&STANDARD_NO_PAD
243+
.encode(store_cipher.hash_key(table_name, self.3.as_encoded_string().as_bytes())),
252244
KEY_SEPARATOR,
253-
&base64_encode(
254-
store_cipher.hash_key(table_name, self.4.as_encoded_string().as_bytes()),
255-
&STANDARD_NO_PAD,
256-
),
245+
&STANDARD_NO_PAD
246+
.encode(store_cipher.hash_key(table_name, self.4.as_encoded_string().as_bytes())),
257247
]
258248
.concat()
259249
}

0 commit comments

Comments
 (0)