Skip to main content

codec_base64url/
encode.rs

1// SPDX-FileCopyrightText: Copyright © 2026 ReallyMe LLC. All rights reserved
2//
3// SPDX-License-Identifier: Apache-2.0
4
5use base64::{engine::general_purpose::URL_SAFE_NO_PAD, Engine as _};
6
7/// Encode bytes as RFC 4648 section 5 Base64URL without padding.
8pub fn bytes_to_base64url(bytes: &[u8]) -> String {
9    URL_SAFE_NO_PAD.encode(bytes)
10}