This commit is contained in:
Sven Weidauer 2022-11-23 16:45:30 +01:00
parent c7deb3c71d
commit ddf5ec2274
56 changed files with 6756 additions and 1 deletions

View file

@ -0,0 +1,24 @@
import CryptoKit
import Foundation
func md5(_ string: String) -> String {
let digest = Insecure.MD5.hash(data: Data(string.utf8))
digest.withUnsafeBytes { ptr in
ptr[0] + ptr[1]
}
digest.pref
return digest.reduce("") {
$0 + String($1, radix: 16)
}
}
let key = "abcdef"
var iterator = (0...).lazy.map { ($0, md5("\(key)\($0)")) }
.filter { $0.1.hasPrefix("00000" ) }
.makeIterator()
iterator.next()

View file

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<playground version='5.0' target-platform='ios' buildActiveScheme='true' importAppTypes='true'>
<timeline fileName='timeline.xctimeline'/>
</playground>

View file

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "group:">
</FileRef>
</Workspace>