summaryrefslogtreecommitdiffstats
path: root/src/test/java
diff options
context:
space:
mode:
authorFlorian Zschocke <f.zschocke+git@gmail.com>2023-10-15 16:26:35 +0200
committerFlorian Zschocke <f.zschocke+git@gmail.com>2023-10-15 16:26:35 +0200
commit9499952e791fcdf53c39e95216c19ddb8c84c4cc (patch)
treebf442b22011d3286d629755e2922358025f38887 /src/test/java
parentfd2eb897e1386ded3b55f5a6075b5fc3258a5d31 (diff)
downloadgitblit-9499952e791fcdf53c39e95216c19ddb8c84c4cc.tar.gz
gitblit-9499952e791fcdf53c39e95216c19ddb8c84c4cc.zip
Add function to calculate SHA-256 has sum to StingUtils.
Diffstat (limited to 'src/test/java')
-rw-r--r--src/test/java/com/gitblit/tests/StringUtilsTest.java6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/test/java/com/gitblit/tests/StringUtilsTest.java b/src/test/java/com/gitblit/tests/StringUtilsTest.java
index cc579888..723a8930 100644
--- a/src/test/java/com/gitblit/tests/StringUtilsTest.java
+++ b/src/test/java/com/gitblit/tests/StringUtilsTest.java
@@ -134,6 +134,12 @@ public class StringUtilsTest extends GitblitUnitTest {
}
@Test
+ public void testSHA256() throws Exception {
+ assertEquals("badf72532e259f2b67a40475486c7e71bf48bc71d7b0d43d8e99acfb3ac24e1b",
+ StringUtils.getSHA256("margaret@london.uk"));
+ }
+
+ @Test
public void testMD5() throws Exception {
assertEquals("77fb8d95331f0d557472f6776d3aedf6",
StringUtils.getMD5("blob 16\000what is up, doc?"));