From ae9c65ed36bb570028902f425facb02e259885b3 Mon Sep 17 00:00:00 2001 From: Rikj000 Date: Wed, 20 Mar 2024 14:33:47 +0100 Subject: [PATCH] =?UTF-8?q?=E2=9A=A1=EF=B8=8F=20Updated=20`CardIo::GetCard?= =?UTF-8?q?UID`=20-=20Support=20custom=20`cardUidLength`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SnappyWinscard/CardIo.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/SnappyWinscard/CardIo.cs b/SnappyWinscard/CardIo.cs index f2537e3..d5c887d 100644 --- a/SnappyWinscard/CardIo.cs +++ b/SnappyWinscard/CardIo.cs @@ -167,7 +167,7 @@ private string ReaderName } - public string GetCardUID()//only for mifare 1k cards + public string GetCardUID(int cardUidLength = 8) //only for mifare 1k cards { if (ConnectCard()) { @@ -182,8 +182,9 @@ private string ReaderName nint outBytes = receivedUID.Length; if (SCardTransmit(sendBytes, receivedUID, ref request, ref outBytes)) { + var cardUidByteSize = cardUidLength / 2; cardUID = receivedUID - .Take(4) + .Take(cardUidByteSize) .Aggregate( "", (a, b)