Nov 5, 2017

Hash String via SHA-256 in Java

You can use Guava, as the following:

Hashing.sha256().hashString("MyStringToBeHashed", Charsets.UTF_8);

Maven dependency:

<dependency>
            <groupId>com.google.guava</groupId>
            <artifactId>guava</artifactId>
            <version>17.0</version>
            <type>jar</type>
</dependency>

Post a Comment

Featured Post

Setup Chinese Input Method in Ubuntu 17.10 Artful

sudo apt install ibus-sunpinyin After either of those commands do not forget to restart the IBus daemon ibus restart You might need t...