summaryrefslogtreecommitdiffstats
path: root/src/test/java/org
diff options
context:
space:
mode:
authorCGantert345 <57003061+CGantert345@users.noreply.github.com>2023-07-28 14:14:36 +0200
committerGitHub <noreply@github.com>2023-07-28 14:14:36 +0200
commit69ff8d066c138552ffaf1c31eaaf0ab7ded94bcb (patch)
tree280e81fe489f5a3944e0c8b8199019377c57eef0 /src/test/java/org
parentMerge pull request #68 from UnionInternationalCheminsdeFer/customerCardV1 (diff)
parent- decode TLB also in case of wrong non-numeric formating of number (diff)
downloadUIC-barcode-69ff8d066c138552ffaf1c31eaaf0ab7ded94bcb.tar
UIC-barcode-69ff8d066c138552ffaf1c31eaaf0ab7ded94bcb.tar.gz
UIC-barcode-69ff8d066c138552ffaf1c31eaaf0ab7ded94bcb.tar.bz2
UIC-barcode-69ff8d066c138552ffaf1c31eaaf0ab7ded94bcb.tar.lz
UIC-barcode-69ff8d066c138552ffaf1c31eaaf0ab7ded94bcb.tar.xz
UIC-barcode-69ff8d066c138552ffaf1c31eaaf0ab7ded94bcb.tar.zst
UIC-barcode-69ff8d066c138552ffaf1c31eaaf0ab7ded94bcb.zip
Diffstat (limited to 'src/test/java/org')
-rw-r--r--src/test/java/org/uic/barcode/test/utils/TestUtils.java11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/test/java/org/uic/barcode/test/utils/TestUtils.java b/src/test/java/org/uic/barcode/test/utils/TestUtils.java
index 9791b02..cee5623 100644
--- a/src/test/java/org/uic/barcode/test/utils/TestUtils.java
+++ b/src/test/java/org/uic/barcode/test/utils/TestUtils.java
@@ -28,6 +28,17 @@ public class TestUtils {
}
+ /* s must be an even-length string. */
+ public static byte[] hexStringToByteArray(String s) {
+ int len = s.length();
+ byte[] data = new byte[len / 2];
+ for (int i = 0; i < len; i += 2) {
+ data[i / 2] = (byte) ((Character.digit(s.charAt(i), 16) << 4)
+ + Character.digit(s.charAt(i+1), 16));
+ }
+ return data;
+ }
+
public static Date parseDate (String source){
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");