1717package com .iexec .commons .poco .utils ;
1818
1919import jakarta .xml .bind .DatatypeConverter ;
20+ import lombok .AccessLevel ;
21+ import lombok .NoArgsConstructor ;
2022import org .web3j .utils .Numeric ;
2123
2224import java .math .BigInteger ;
2325import java .util .Arrays ;
2426import java .util .regex .Pattern ;
2527
28+ @ NoArgsConstructor (access = AccessLevel .PRIVATE )
2629public class BytesUtils {
2730
2831 // "0x0000000000000000000000000000000000000000"
@@ -31,21 +34,12 @@ public class BytesUtils {
3134 public static final int BYTES_32_SIZE = 32 ;
3235 //"0x0000000000000000000000000000000000000000000000000000000000000000"
3336 public static final String EMPTY_HEX_STRING_32 = BytesUtils .bytesToString (new byte [BYTES_32_SIZE ]);
34- /**
35- * @deprecated Use {@link BytesUtils#EMPTY_HEX_STRING_32} instead.
36- */
37- @ Deprecated
38- public static final String EMPTY_HEXASTRING_64 = BytesUtils .bytesToString (new byte [BYTES_32_SIZE ]);
3937 private static final int BYTES_32_HEX_STRING_SIZE = BYTES_32_SIZE * 2 ; // 64
4038 private static final int BYTES_32_HEX_STRING_WITH_PREFIX_SIZE = 2 + BYTES_32_HEX_STRING_SIZE ;// 2 + 64
4139 private static final String HEX_REGEX = "\\ p{XDigit}+$" ;
4240 private static final Pattern HEX_PATTERN = Pattern .compile ("(?i)^(0x)?" + HEX_REGEX );
4341 private static final Pattern HEX_WITH_PREFIX_PATTERN = Pattern .compile ("^0x" + HEX_REGEX );
4442
45- private BytesUtils () {
46- throw new UnsupportedOperationException ();
47- }
48-
4943 public static String bytesToString (byte [] bytes ) {
5044 return Numeric .toHexString (bytes );
5145 }
0 commit comments