Replace deprecated base64 call

Signed-off-by: Cléo REBERT <cleo.rebert-ext@treezor.com>
This commit is contained in:
Cléo REBERT 2023-03-28 10:58:39 +02:00
parent e4e055dedd
commit c2ba6d190b
No known key found for this signature in database
GPG Key ID: 0FA097951CF65367
1 changed files with 2 additions and 1 deletions

View File

@ -699,6 +699,7 @@ impl TOTP {
#[cfg(feature = "qr")]
pub fn get_qr(&self) -> Result<String, String> {
use image::ImageEncoder;
use base64::{Engine as _, engine::general_purpose};
let url = self.get_url();
let mut vec = Vec::new();
@ -729,7 +730,7 @@ impl TOTP {
image_size,
image::ColorType::L8,
) {
Ok(_) => Ok(base64::encode(vec)),
Ok(_) => Ok(general_purpose::STANDARD.encode(vec)),
Err(err) => Err(err.to_string()),
}
}