|0.1.4||May 13, 2021|
|0.1.3||Apr 29, 2021|
|0.1.2||Apr 29, 2021|
|0.1.1||Apr 29, 2021|
|0.1.0||Apr 29, 2021|
#466 in Encoding
31 downloads per month
Used in 5 crates (2 directly)
Esperanto for "access"
Aliri is a family of crates intended to help build access control, particularly of web APIs, where a token is the primary means of providing access.
aliri_base64 crate provides some utilities for more easily working
with byte arrays and buffers that need to be serialized using Base64 encoding.
This is particularly necessary for many of the types that
aliri works with,
but may also be of use to others as well.
The underlying encoding/decoding mechanism is provided by the
Base64Ref wrap owned and borrowed byte arrays that must be
serialized in the standard Base64 encoding with padding.
Base64UrlRef wrap owned and borrowed byte arrays that
must be serialized in the URL-safe Base64 encoding with no padding.
Additional encodings may be added in the future, but these were the two primary encodings required to support my base set of use cases.
Aliri Base64 makes use of two lines of unsafe code. This unsafe code is limited
to the functions that allow the
Base64UrlRef to wrap borrowed
byte slices. This reinterpretation is safe because these types are transparent
#[repr(transparent)], and thus share the exact same
representation as the underlying slice. This is currently necessary as there is
currently no way to transmute equivalent representations of dynamically sized
values in safe Rust.
For the above reason, this crate uses
#![deny(unsafe_code)] rather than
#![forbid(unsafe_code)]. The only
#![allow(unsafe_code)] in the crate can
be located in the private
Note that, because
cargo-geiger has difficulty parsing out unsafe usage from
within macros, that tool won't report these crates as "radioactive", but
probably should. Do your due diligence.