forked from kamax-matrix/mxisd
-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Anatoly Sablin
committed
Dec 6, 2019
1 parent
cbb9fce
commit 17ebc2a
Showing
2 changed files
with
8 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,11 +5,14 @@ | |
import org.apache.commons.codec.digest.DigestUtils; | ||
import org.junit.Test; | ||
|
||
import java.util.Base64; | ||
|
||
public class HashEngineTest { | ||
|
||
@Test | ||
public void sha256test() { | ||
assertEquals("a26de61ae3055f84b33ac1a179b9ad5301f9109024f4db1ae653ea525d2136f4", | ||
DigestUtils.sha256Hex("[email protected] email I9x4vpcWjqp9X8iiOY4a")); | ||
Base64.Encoder encoder = Base64.getUrlEncoder().withoutPadding(); | ||
assertEquals("rujYzy1w0JxulN_rVlErGUmkdXT5znL0sjSF_IWreko", | ||
encoder.encodeToString(DigestUtils.sha256("[email protected] email I9x4vpcWjqp9X8iiOY4a"))); | ||
} | ||
} |