Skip to content

Commit

Permalink
Add crypto impl for iOS
Browse files Browse the repository at this point in the history
  • Loading branch information
hoc081098 committed Jun 3, 2022
1 parent 0671943 commit aa028d8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions ios/Runner/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ private enum AESConfig {
}

private func complete(result: @escaping FlutterResult, with error: Error) {
debugPrint("[NODE_AUTH] Error: ", error)
NSLog("\n[NODE_AUTH] Error: \(error)")

executeOnMain {
result(
Expand Down Expand Up @@ -76,7 +76,7 @@ private func useAES(
block: @escaping (AES, [UInt8]) throws -> [UInt8]
) {
guard let inputBytes = inputToBytes(input) else {
print("[NODE_AUTH] Error: inputToBytes returns nil")
NSLog("\n[NODE_AUTH] Error: inputToBytes returns nil")

executeOnMain {
result(
Expand All @@ -102,7 +102,7 @@ private func useAES(

let outputBytes = try block(aes, inputBytes)
guard let stringResult = bytesToString(outputBytes) else {
print("[NODE_AUTH] Error: bytesToString returns nil")
NSLog("\n[NODE_AUTH] Error: bytesToString returns nil")

executeOnMain {
result(
Expand All @@ -119,7 +119,7 @@ private func useAES(
let end = DispatchTime.now()
let nanoTime = end.uptimeNanoseconds - start.uptimeNanoseconds
let millisTime = Double(nanoTime) / 1_000_000
print("[NODE_AUTH] Time: \(millisTime) ms")
NSLog("\n[NODE_AUTH] Time: \(millisTime) ms")

executeOnMain { result(stringResult) }
} catch {
Expand Down

0 comments on commit aa028d8

Please sign in to comment.