Skip to content

Latest commit

 

History

History
61 lines (42 loc) · 1.28 KB

README.md

File metadata and controls

61 lines (42 loc) · 1.28 KB

SHA3 Java Implementation

build codecov

This is a java implementation of SHA3 (Keccak), based on the: PDF.


Dependency

Maven

<dependency>
  <groupId>pl.thewalkingcode.sha3</groupId>
  <artifactId>sha3-java</artifactId>
  <version>1.1.1</version>
</dependency>

Gradle

implementation 'pl.thewalkingcode.sha3:sha3-java:1.1.1'

Usage

For the text:

String input = "...";

Type type = Type.SHA3_256;
Sha3 sha3 = new Sha3(type);

byte[] encode = sha3.encode(inputStream);

For the file:

File file = new File("...");
InputStream inputStream = new FileInputStream(file);

Type type = Type.SHA3_256;
Sha3 sha3 = new Sha3(type);

byte[] encode = sha3.encode(inputStream);

Supported types:

Type type = Type.SHA3_224 / Type.SHA3_256 / Type.SHA3_384 / Type.SHA3_512; 

Repositories with an example of usage: