COVIDSafe code from version 2.2

This commit is contained in:
covidsafe-support 2021-02-02 11:02:00 +11:00
parent 9e6e4604ef
commit 682e02ddc9
67 changed files with 3645 additions and 464 deletions

View file

@ -284,9 +284,10 @@ public extension PayloadData {
let message = decodedPayload.msg
return String(message.suffix(25))
} catch {
let startIndex = count >= 3 ? 3 : 0
let endIndex = count >= 3 ? count-3 : 0
return String(subdata(in: startIndex..<endIndex).base64EncodedString().prefix(6))
guard count > 0 else {
return ""
}
return String(self.base64EncodedString().prefix(6))
}
}
}