mirror of
https://github.com/matrix-org/matrix-rust-sdk.git
synced 2026-05-06 06:53:32 -04:00
crypto: Enable decoding padded base64
Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
This commit is contained in:
@@ -28,8 +28,11 @@ use base64::{
|
||||
};
|
||||
use matrix_sdk_common::instant::Instant;
|
||||
|
||||
const STANDARD_NO_PAD: GeneralPurpose =
|
||||
GeneralPurpose::new(&alphabet::STANDARD, general_purpose::NO_PAD);
|
||||
const STANDARD_NO_PAD: GeneralPurpose = GeneralPurpose::new(
|
||||
&alphabet::STANDARD,
|
||||
general_purpose::NO_PAD
|
||||
.with_decode_padding_mode(base64::engine::DecodePaddingMode::Indifferent),
|
||||
);
|
||||
|
||||
/// Decode the input as base64 with no padding.
|
||||
pub fn decode(input: impl AsRef<[u8]>) -> Result<Vec<u8>, DecodeError> {
|
||||
|
||||
Reference in New Issue
Block a user