Files
bundesmessenger-ios/Riot/Utils/Base32Coder.swift
T
Mauro Romito 12837d4b89 update license
2024-09-25 12:24:52 +02:00

18 lines
464 B
Swift

//
// Copyright 2020-2024 New Vector Ltd.
//
// SPDX-License-Identifier: AGPL-3.0-only
// Please see LICENSE in the repository root for full details.
//
import Foundation
import SwiftBase32
final class Base32Coder {
static func encodedString(_ string: String, padding: Bool = true) -> String {
let encodedString = string.base32EncodedString
return padding ? encodedString : encodedString.replacingOccurrences(of: "=", with: "")
}
}