public String sha256Hex ( String str ) { byte [ ] a = DigestUtils . sha256 ( str ) ; StringBuilder sb = new StringBuilder ( a . length * 2 ) ; for ( byte b : a ) sb . append ( String . format ( "%02x" , ) ) ; return sb . toString ( ) ; }
Hex encodes sha256 output for android support .