Skip to content

Instantly share code, notes, and snippets.

@Yorzic
Created August 9, 2020 15:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Yorzic/5011620ca00054675362606ac17c4dba to your computer and use it in GitHub Desktop.
Save Yorzic/5011620ca00054675362606ac17c4dba to your computer and use it in GitHub Desktop.
What's the gist physicist
import CryptoKit
extension String {
var md5: String {
let digest = Insecure.MD5.hash(data: self.data(using: .utf8) ?? Data())
return digest.map {
String(format: "%02hhx", $0)
}.joined()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment