19 lines
423 B
Swift
19 lines
423 B
Swift
//
|
|
// URL.swift
|
|
// EmployeeDirectory
|
|
//
|
|
// Created by Matt Bruce on 1/20/25.
|
|
//
|
|
import Foundation
|
|
import CryptoKit
|
|
|
|
extension URL {
|
|
|
|
/// This will has the URL absoluteString into a that is consistent.
|
|
internal var uniqueIdentifier: String {
|
|
let data = Data(absoluteString.utf8)
|
|
let hash = SHA256.hash(data: data)
|
|
return hash.compactMap { String(format: "%02x", $0) }.joined()
|
|
}
|
|
}
|