From 9b1629ca127065c7f466b7c287a5658b1d9fa19f Mon Sep 17 00:00:00 2001 From: zhanglin33 Date: Thu, 30 May 2019 09:35:25 +0800 Subject: [PATCH] replace .getBytes() with BytesUtils.toBytes() --- .../blockchain/crypto/utils/classic/SHA256UtilsTest.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/source/crypto/crypto-classic/src/test/java/test/com/jd/blockchain/crypto/utils/classic/SHA256UtilsTest.java b/source/crypto/crypto-classic/src/test/java/test/com/jd/blockchain/crypto/utils/classic/SHA256UtilsTest.java index 498722e6..f8a40d78 100644 --- a/source/crypto/crypto-classic/src/test/java/test/com/jd/blockchain/crypto/utils/classic/SHA256UtilsTest.java +++ b/source/crypto/crypto-classic/src/test/java/test/com/jd/blockchain/crypto/utils/classic/SHA256UtilsTest.java @@ -1,6 +1,7 @@ package test.com.jd.blockchain.crypto.utils.classic; import com.jd.blockchain.crypto.utils.classic.SHA256Utils; +import com.jd.blockchain.utils.io.BytesUtils; import org.bouncycastle.util.encoders.Hex; import org.junit.Test; @@ -17,9 +18,9 @@ public class SHA256UtilsTest { @Test public void hashTest() { - byte[] data1 = "abc".getBytes(); - byte[] data2 = "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq".getBytes(); - byte[] data3 = "aaaaaaaaaa".getBytes(); + byte[] data1 = BytesUtils.toBytes("abc"); + byte[] data2 = BytesUtils.toBytes("abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq"); + byte[] data3 = BytesUtils.toBytes("aaaaaaaaaa"); byte[] result1 = SHA256Utils.hash(data1); byte[] result2 = SHA256Utils.hash(data2);