Skip to content

Commit

Permalink
Replace deprecated base64 method calls.
Browse files Browse the repository at this point in the history
  • Loading branch information
SergioBenitez committed Jan 23, 2023
1 parent 2a70042 commit efa8d9c
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/secure/mod.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
extern crate rand;
extern crate base64;

mod base64 {
use base64::{DecodeError, Engine, prelude::BASE64_STANDARD};

/// Encode `input` as the standard base64 with padding.
pub(crate) fn encode<T: AsRef<[u8]>>(input: T) -> String {
BASE64_STANDARD.encode(input)
}

/// Decode `input` as the standard base64 with padding.
pub(crate) fn decode<T: AsRef<[u8]>>(input: T) -> Result<Vec<u8>, DecodeError> {
BASE64_STANDARD.decode(input)
}
}

#[macro_use]
mod macros;
Expand Down

0 comments on commit efa8d9c

Please sign in to comment.