Skip to content

Commit

Permalink
Print hash results in Debug builds
Browse files Browse the repository at this point in the history
  • Loading branch information
cyb3rko committed Feb 2, 2023
1 parent c12736b commit 6652df5
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ package com.cyb3rko.pincredible.crypto

import android.security.keystore.KeyGenParameterSpec
import android.security.keystore.KeyProperties
import android.util.Log
import com.cyb3rko.pincredible.BuildConfig
import com.cyb3rko.pincredible.crypto.xxhash3.XXH3_128
import com.cyb3rko.pincredible.utils.ObjectSerializer
import java.io.File
Expand Down Expand Up @@ -52,7 +54,11 @@ internal object CryptoManager {
for (i in ciphertextBytes.indices) {
sb.append(((ciphertextBytes[i] and 0xff.toByte()) + 0x100).toString(16).substring(1))
}
return sb.toString()
val hash = sb.toString()
if (BuildConfig.DEBUG) {
Log.d("CryptoManager", "Hash: $hash")
}
return hash
}

// Random
Expand Down

0 comments on commit 6652df5

Please sign in to comment.