From 47a75bbd57ee76db90d9385e04bec2b7d5abd513 Mon Sep 17 00:00:00 2001 From: Jeroen Leenarts Date: Wed, 26 Sep 2018 11:23:13 +0200 Subject: [PATCH] Fixe base 64 regex format. Signed-off-by: Jason A. Donenfeld --- WireGuard/Extensions/String+Base64.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/WireGuard/Extensions/String+Base64.swift b/WireGuard/Extensions/String+Base64.swift index b94dc88..f6d61b5 100644 --- a/WireGuard/Extensions/String+Base64.swift +++ b/WireGuard/Extensions/String+Base64.swift @@ -11,7 +11,7 @@ import Foundation extension String { func isBase64() -> Bool { - let base64Predicate = NSPredicate(format: "SELF MATCHES %@", "^([A-Za-z0-9+/]{4})*([A-Za-z0-9+/]{4}|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{2}==)$") + let base64Predicate = NSPredicate(format: "SELF MATCHES %@", "^[a-zA-Z0-9+/]{43}=$") return base64Predicate.evaluate(with: self) }