aboutsummaryrefslogtreecommitdiff
path: root/iosApp/iosApp/Shared/Utils.swift
diff options
context:
space:
mode:
Diffstat (limited to 'iosApp/iosApp/Shared/Utils.swift')
-rw-r--r--iosApp/iosApp/Shared/Utils.swift19
1 files changed, 19 insertions, 0 deletions
diff --git a/iosApp/iosApp/Shared/Utils.swift b/iosApp/iosApp/Shared/Utils.swift
new file mode 100644
index 0000000..cacf49b
--- /dev/null
+++ b/iosApp/iosApp/Shared/Utils.swift
@@ -0,0 +1,19 @@
+//
+// Utils.swift
+// iosApp
+//
+// Created by Iván on 30/01/22.
+// Copyright © 2022 orgName. All rights reserved.
+//
+
+import Foundation
+import CryptoKit
+
+class Utils {
+ static func MD5(string: String) -> String {
+ let digest = Insecure.MD5.hash(data: string.data(using: .utf8) ?? Data())
+ return digest.map {
+ String(format: "%02hhx", $0)
+ }.joined()
+ }
+}