1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
// Copyright 2020-2025 Velithris
// SPDX-License-Identifier: MIT
//! This library provides heavily optimized routines for decoding and encoding
//! base64 used for [WeakAuras]-compatible strings.
//!
//! Why does this library exist?
//! Base64 used in WeakAuras packs bits in a non-standard way,
//! this makes it impossible to use existing implementations,
//! even if they do support custom alphabets.
//!
//! # Decoding example
//!
//! This is how you can use the library to decode base64-encoded data.
//!
//! use weakauras_codec_base64::{DecodeError, decode_to_vec};
//!
//! fn main() -> Result<(), DecodeError> {
//! assert_eq!(decode_to_vec(b"ivgBS9glGC3BYXgzHa")?, b"Hello, world!");
//! Ok(())
//! }
//! ```
//!
//! # Encoding example
//!
//! This is how you can use the library to encode data as base64.
//!
//! use weakauras_codec_base64::{EncodeError, encode_to_string};
//!
//! fn main() -> Result<(), EncodeError> {
//! assert_eq!(encode_to_string(b"Hello, world!")?, "ivgBS9glGC3BYXgzHa");
//! Ok(())
//! }
//! ```
//!
//! # Crate features
//!
//! * **std** - Enable features that require the standard library. As of now, it's used only for runtime SIMD feature detection on x86_64 and x86 CPUs. **Enabled** by default.
//! * **alloc** - Enable APIs that allocate, like `decode_to_vec` and `encode_to_string`. **Enabled** by default.
//!
//! [WeakAuras]: https://weakauras.wtf
extern crate std;
extern crate alloc;
/// Decoding routines.
/// Encoding routines.
/// Error types.
pub
pub use ;
pub use ;
pub use *;
pub use decode_to_vec;
pub use ;