aboutsummaryrefslogtreecommitdiff
path: root/iosApp/iosApp/Shared/Utils.swift
blob: cacf49b28f66df616afeef9ec34a3ef347e740ac (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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()
    }
}