From 6f7f7100e1748fb50060764d5334ed3520242063 Mon Sep 17 00:00:00 2001 From: Nicolas Werner Date: Wed, 29 Sep 2021 17:10:08 +0200 Subject: [PATCH] fix: use explicit type in fold instead of cast --- lib/encryption/ssss.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/encryption/ssss.dart b/lib/encryption/ssss.dart index fc1eb2c7..f04602cd 100644 --- a/lib/encryption/ssss.dart +++ b/lib/encryption/ssss.dart @@ -123,7 +123,7 @@ class SSSS { static Uint8List decodeRecoveryKey(String recoveryKey) { final result = base58.decode(recoveryKey.replaceAll(' ', '')); - final parity = result.fold(0, (a, b) => (a as int) ^ b); + final parity = result.fold(0, (a, b) => a ^ b); if (parity != 0) { throw Exception('Incorrect parity'); } @@ -144,7 +144,7 @@ class SSSS { static String encodeRecoveryKey(Uint8List recoveryKey) { final keyToEncode = [...olmRecoveryKeyPrefix, ...recoveryKey]; - final parity = keyToEncode.fold(0, (a, b) => (a as int) ^ b); + final parity = keyToEncode.fold(0, (a, b) => a ^ b); keyToEncode.add(parity); // base58-encode and add a space every four chars return base58