mirror of
https://github.com/yuezk/GlobalProtect-openconnect.git
synced 2026-11-19 06:26:14 -05:00
Refactor using Tauri (#278)
This commit is contained in:
1 parent
edc13ed14d
commit
04a916a3e1
199 files changed
+10153
-7203
No files matched your search
@@ -0,0 +1,21 @@
|
||||
use base64::{engine::general_purpose, Engine};
|
||||
|
||||
pub fn encode(data: &[u8]) -> String {
|
||||
let engine = general_purpose::STANDARD;
|
||||
|
||||
engine.encode(data)
|
||||
}
|
||||
|
||||
pub fn decode_to_vec(s: &str) -> anyhow::Result<Vec<u8>> {
|
||||
let engine = general_purpose::STANDARD;
|
||||
let decoded = engine.decode(s)?;
|
||||
|
||||
Ok(decoded)
|
||||
}
|
||||
|
||||
pub(crate) fn decode_to_string(s: &str) -> anyhow::Result<String> {
|
||||
let decoded = decode_to_vec(s)?;
|
||||
let decoded = String::from_utf8(decoded)?;
|
||||
|
||||
Ok(decoded)
|
||||
}
|
||||
Reference in new issue
Block a user