mirror of
https://github.com/passepartoutvpn/wireguard-apple.git
synced 2025-01-07 09:12:37 +00:00
47a75bbd57
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
19 lines
366 B
Swift
19 lines
366 B
Swift
//
|
|
// String+Base64.swift
|
|
// WireGuard
|
|
//
|
|
// Created by Eric Kuck on 8/15/18.
|
|
// Copyright © 2018 WireGuard LLC. All rights reserved.
|
|
//
|
|
|
|
import Foundation
|
|
|
|
extension String {
|
|
|
|
func isBase64() -> Bool {
|
|
let base64Predicate = NSPredicate(format: "SELF MATCHES %@", "^[a-zA-Z0-9+/]{43}=$")
|
|
return base64Predicate.evaluate(with: self)
|
|
}
|
|
|
|
}
|