summaryrefslogtreecommitdiffstats
path: root/src/main/java/org/uic/barcode/asn1
diff options
context:
space:
mode:
authorCGantert345 <57003061+CGantert345@users.noreply.github.com>2022-01-25 13:33:37 +0100
committerCGantert345 <57003061+CGantert345@users.noreply.github.com>2022-01-25 13:33:37 +0100
commit7af6c4ca50322258bbd23214920c4c9122482966 (patch)
tree83be3be35d497fbdc00bc5c10a7dc0bad2bd8aad /src/main/java/org/uic/barcode/asn1
parentsignature validation changed to work with teh dynamic header version 2. (diff)
downloadUIC-barcode-7af6c4ca50322258bbd23214920c4c9122482966.tar
UIC-barcode-7af6c4ca50322258bbd23214920c4c9122482966.tar.gz
UIC-barcode-7af6c4ca50322258bbd23214920c4c9122482966.tar.bz2
UIC-barcode-7af6c4ca50322258bbd23214920c4c9122482966.tar.lz
UIC-barcode-7af6c4ca50322258bbd23214920c4c9122482966.tar.xz
UIC-barcode-7af6c4ca50322258bbd23214920c4c9122482966.tar.zst
UIC-barcode-7af6c4ca50322258bbd23214920c4c9122482966.zip
Diffstat (limited to 'src/main/java/org/uic/barcode/asn1')
-rw-r--r--src/main/java/org/uic/barcode/asn1/uper/AsnUtils.java16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/main/java/org/uic/barcode/asn1/uper/AsnUtils.java b/src/main/java/org/uic/barcode/asn1/uper/AsnUtils.java
index dbb95c9..414f181 100644
--- a/src/main/java/org/uic/barcode/asn1/uper/AsnUtils.java
+++ b/src/main/java/org/uic/barcode/asn1/uper/AsnUtils.java
@@ -1,5 +1,7 @@
package org.uic.barcode.asn1.uper;
+import java.math.BigInteger;
+
public class AsnUtils {
@@ -55,5 +57,19 @@ public class AsnUtils {
boolean result = (bytes[index / 8] & mask[index % 8]) != 0;
return result;
}
+
+ public static byte[] shiftBytesToLeft(byte[] bytes, int shift) {
+
+ // create from array
+ BigInteger bigInt = new BigInteger(bytes);
+
+ // shift
+ BigInteger shiftInt = bigInt.shiftLeft(shift);
+
+ // back to array
+ return shiftInt.toByteArray();
+
+ }
+
}