1

I would like to compute the sha256 digest on a string. Is it safe to compute the hash on the main ui thread? Or do i have to run this in the background?

prostock
  • 9,327
  • 19
  • 70
  • 118

1 Answers1

3

I'm not completely clear why you're hashing such a short string — the hash will be significantly larger than the input — but that should be very fast. You might run some tests to confirm that, but I expect that you can do that on the main application thread without issue.

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491