Repository: tanmoysrt/pyaadhaar (language: python)

Issue:
Bug Fix - Image and Signature Extraction 
The following changes must fix the issue regarding saving of Image and extraction of signature from the newer versions of AadharQRs


Discussion / hints:
@Arkajit-Datta can you send me the latest docs of secure QR
sure @Tanmoy741127 
> sure @Tanmoy741127

Is this available publicly?
@srikanthlogic , oh yes it is, let me share the link here, https://uidai.gov.in/images/resource/User_manulal_QR_Code_15032019.pdf
Sorry @Tanmoy741127, I was tied up the lately, will be looking into your comments if changes are required, Thanks!

Thanks. I will look at that.

On Thu, 16 Feb, 2023, 5:28 pm Arkajit Datta, ***@***.***>
wrote:

> Sorry @Tanmoy741127 <https://github.com/Tanmoy741127>, I was tied up the
> lately, will be looking into your comments if changes are required, Thanks!
>
> —
> Reply to this email directly, view it on GitHub
> <https://github.com/Tanmoy741127/pyaadhaar/pull/10#issuecomment-1432976282>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/ANVU24T426WAICWPGKNFR6DWXYI5HANCNFSM6AAAAAAT7LSHCM>
> .
> You are receiving this because you were mentioned.Message ID:
> ***@***.***>
>

> @srikanthlogic , oh yes it is, let me share the link here, https://uidai.gov.in/images/resource/User_manulal_QR_Code_15032019.pdf

Are you sure this is the newest one ? Because while building the library I have followed this one published on 2019.

Fix patch:
diff --git a/.gitignore b/.gitignore
index 1ff59cf..ff555ba 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1,8 @@
 /env/*
 .env/*
+venv
+**/test.py
+**/tests.py
+**/__pycache__
+__pycache__
+build
\ No newline at end of file
diff --git a/build/lib/pyaadhaar/__init__.py b/build/lib/pyaadhaar/__init__.py
deleted file mode 100644
index e69de29..0000000
diff --git a/build/lib/pyaadhaar/decode.py b/build/lib/pyaadhaar/decode.py
deleted file mode 100644
index 3554787..0000000
--- a/build/lib/pyaadhaar/decode.py
+++ /dev/null
@@ -1,285 +0,0 @@
-import zlib
-from io import BytesIO
-from PIL import Image, ImageFile
-ImageFile.LOAD_TRUNCATED_IMAGES = True
-import xml.etree.ElementTree as ET
-from io import BytesIO
-import base64
-import zipfile
-import pyaadhaar
-
-
-class AadhaarSecureQr:
-    # This is the class for Adhaar Secure Qr code..  In this version of code the data is in encrypted format
-    # The special thing of this type of QR is that we can extract the photo of user from the data
-    # This class now supports 2022 version of Aadhaar QR codes [version-2]
-    # For more information check here : https://103.57.226.101/images/resource/User_manulal_QR_Code_15032019.pdf
-
-    def __init__(self, base10encodedstring):
-        self.base10encodedstring = base10encodedstring
-        self.details = ["version","email_mobile_status","referenceid", "name", "dob", "gender", "careof", "district", "landmark",
-                        "house", "location", "pincode", "postoffice", "state", "street", "subdistrict", "vtc", "last_4_digits_mobile_no"]
-        self.delimeter = [-1]
-        self.data = {}
-        self._convert_base10encoded_to_decompressed_array()
-        self._check_aadhaar_version()
-        self._create_delimeter()
-        self._extract_info_from_decompressed_array()
-
-    def _convert_base10encoded_to_decompressed_array(self):
-        # This function converts base10encoded string to a decompressed array
-        bytes_array = self.base10encodedstring.to_bytes(5000, 'big').lstrip(b'\x00')
-        self.decompressed_array = zlib.decompress(
-            bytes_array, 16+zlib.MAX_WBITS)
-
-    def _check_aadhaar_version(self):
-        # This function will check for the new 2022 version-2 Aadhaar QRs
-        # If not found it will remove the "version" key from self.details, Defaulting to normal Secure QRs
-        if not self.decompressed_array[0:2].decode("ISO-8859-1") == 'V2':
-            self.details.pop(0) # Removing "Version"
-            self.details.pop() # Removing "Last_4_digits_of_mobile_no"
-    def _create_delimeter(self):
-        # This function creates the delimeter which is used to extract the information from the decompressed array
-        for i in range(len(self.decompressed_array)):
-            if self.decompressed_array[i] == 255:
-                self.delimeter.append(i)
-
-    def _extract_info_from_decompressed_array(self):
-        for i in range(len(self.details)):
-            self.data[self.details[i]] = self.decompressed_array[self.delimeter[i] + 1:self.delimeter[i+1]].decode("ISO-8859-1")
-        self.data['adhaar_last_4_digit'] = self.data['referenceid'][0:4]
-        self.data['adhaar_last_digit'] = self.data['referenceid'][3]
-        # Default values to 'email' and 'mobile
-        self.data['email'] = False
-        self.data['mobile'] = False
-        # Updating the fields of 'email' and 'mobile'
-        if int(self.data['email_mobile_status']) == 3 or int(self.data['email_mobile_status']) == 1:
-            self.data['email'] = True
-        if int(self.data['email_mobile_status']) == 3 or int(self.data['email_mobile_status']) == 2:
-            self.data['mobile'] = True
-
-    def decodeddata(self):
-        # Will return the personal data in a dictionary format
-        return self.data
-
-    def signature(self):
-        # Will return the signature value
-        signature = self.decompressed_array[len(
-            self.decompressed_array)-256:len(self.decompressed_array)]
-        return signature
-
-    def signedData(self):
-        # Will return the signed data
-        signeddata = self.decompressed_array[:len(self.decompressed_array)-256]
-        return signeddata
-
-    def isMobileNoRegistered(self):
-        # Will return True if mobile number is registered
-        return self.data['mobile']
-
-    def isEmailRegistered(self):
-        # Will return True if email id is registered
-        return self.data['email']
-
-    def sha256hashOfEMail(self):
-        # Will return the hash of the email id
-        tmp = ""
-        if int(self.data['email_mobile_status']) == 3:
-            tmp = self.decompressed_array[len(
-                self.decompressed_array)-256-32-32:len(self.decompressed_array)-256-32].hex()
-        elif int(self.data['email_mobile_status']) == 1:
-            tmp = self.decompressed_array[len(
-                self.decompressed_array)-256-32:len(self.decompressed_array)-256].hex()
-        return tmp
-
-    def sha256hashOfMobileNumber(self):
-        # Will return the hash of mobile number
-        tmp = ""
-        if int(self.data['email_mobile_status']) == 3 or int(self.data['email_mobile_status']) == 2:
-            tmp = self.decompressed_array[len(
-                self.decompressed_array)-256-32:len(self.decompressed_array)-256].hex()
-        return tmp
-
-    def isImage(self, buffer = 10) -> bool:
-        # Will return bool for availability of image stream in the QR CODE
-        if int(self.data['email_mobile_status']) == 3:
-            if len(self.decompressed_array[self.delimeter[len(self.details)]+1:len(self.decompressed_array)]) < 256+32+32+buffer:
-                return False
-            else:
-                return True
-        elif int(self.data['email_mobile_status']) == 2 or int(self.data['email_mobile_status']) == 1:
-            if len(self.decompressed_array[self.delimeter[len(self.details)]+1:len(self.decompressed_array)]) < 256+32+buffer:
-                return False
-            else:
-                return True
-        elif int(self.data['email_mobile_status']) == 0:
-    
-    def image(self):
-        # Will return the image stream to be used in another function
-        if int(self.data['email_mobile_status']) == 3:
-            print("length --> ", len(self.decompressed_array[self.delimeter[len(self.details)]+1:len(self.decompressed_array)]))
-            return Image.open(BytesIO(self.decompressed_array[self.delimeter[len(self.details)]+1:len(self.decompressed_array)]))
-        elif int(self.data['email_mobile_status']) == 2 or int(self.data['email_mobile_status']) == 1:
-            return Image.open(BytesIO(self.decompressed_array[self.delimeter[len(self.details)]+1:len(self.decompressed_array)]))
-        elif int(self.data['email_mobile_status']) == 0:
-            return Image.open(BytesIO(self.decompressed_array[self.delimeter[len(self.details)]+1:len(self.decompressed_array)]))
-        else:
-            return None
-
-    def saveimage(self, filename):
-        # Will save the image of user
-        image = self.image()
-        image.load()
-        image.save(filename)
-
-    def verifyEmail(self, emailid):
-        # Will return True if emailid match with the given email id
-        generated_sha_mail = pyaadhaar.utils.SHAGenerator(
-            emailid, self.data['adhaar_last_digit'])
-        if generated_sha_mail == self.sha256hashOfEMail():
-            return True
-        else:
-            return False
-
-    def verifyMobileNumber(self, mobileno):
-        # Will return True if mobileno match with the given mobile no
-        generated_sha_mobile = pyaadhaar.utils.SHAGenerator(
-            mobileno, self.data['adhaar_last_digit'])
-        if generated_sha_mobile == self.sha256hashOfMobileNumber():
-            return True
-        else:
-            return False
-
-
-class AadhaarOldQr:
-    # This is the class for Adhaar Normal Qr code..  In this version of code the data is in XML v1.0 format
-    # For more information check here : https://103.57.226.101/images/resource/User_manulal_QR_Code_15032019.pdf
-
-    def __init__(self, qrdata):
-        self.qrdata = qrdata
-        self.xmlparser = ET.XMLParser(encoding="utf-8")
-        self.parsedxml = ET.fromstring(qrdata, parser=self.xmlparser)
-        self.data = self.parsedxml.attrib
-
-    def decodeddata(self):
-        # Will return the decoded datas inn dictionary format
-        return self.data
-
-
-class AadhaarOfflineXML:
-
-    # This is the class for Adhaar Offline XML
-    # The special thing of Offline XML is that we can extract the high quality photo of user from the data
-    # For more information check here : https://103.57.226.101/images/resource/User_manulal_QR_Code_15032019.pdf
-
-    def __init__(self, file, passcode):
-        # Need to pass the zip file and passcode/sharecode to this function
-        self.passcode = passcode
-        self.data = {}
-        zf = zipfile.ZipFile(file, 'r')
-        zf.setpassword(str(self.passcode).encode('utf-8'))
-        filedata = zf.open(zf.namelist()[0]).read()
-        parsedxml = ET.fromstring(
-            filedata, parser=ET.XMLParser(encoding="utf-8"))
-        self.root = parsedxml
-
-        self.hashofmobile = self.root[0][0].attrib['m']
-        self.hashofemail = self.root[0][0].attrib['e']
-
-        if self.hashofmobile != "" and self.hashofemail != "":
-            self.data['email_mobile_status'] = "3"
-        elif self.hashofmobile == "" and self.hashofemail != "":
-            self.data['email_mobile_status'] = "2"
-        elif self.hashofmobile != "" and self.hashofemail == "":
-            self.data['email_mobile_status'] = "1"
-        elif self.hashofmobile == "" and self.hashofemail == "":
-            self.data['email_mobile_status'] = "0"
-
-        self.data['referenceid'] = self.root.attrib['referenceId']
-        self.data['name'] = self.root[0][0].attrib['name']
-        self.data['dob'] = self.root[0][0].attrib['dob']
-        self.data['gender'] = self.root[0][0].attrib['gender']
-        self.data['careof'] = self.root[0][1].attrib['careof']
-        self.data['district'] = self.root[0][1].attrib['dist']
-        self.data['landmark'] = self.root[0][1].attrib['landmark']
-        self.data['house'] = self.root[0][1].attrib['house']
-        self.data['location'] = self.root[0][1].attrib['loc']
-        self.data['pincode'] = self.root[0][1].attrib['pc']
-        self.data['postoffice'] = self.root[0][1].attrib['po']
-        self.data['state'] = self.root[0][1].attrib['state']
-        self.data['street'] = self.root[0][1].attrib['street']
-        self.data['subdistrict'] = self.root[0][1].attrib['subdist']
-        self.data['vtc'] = self.root[0][1].attrib['vtc']
-        self.data['adhaar_last_4_digit'] = self.data['referenceid'][0:4]
-        self.data['adhaar_last_digit'] = self.data['referenceid'][3]
-
-        if self.data['email_mobile_status'] == "0":
-            self.data['email'] = "no"
-            self.data['mobile'] = "no"
-        elif self.data['email_mobile_status'] == "1":
-            self.data['email'] = "yes"
-            self.data['mobile'] = "no"
-        elif self.data['email_mobile_status'] == "2":
-            self.data['email'] = "no"
-            self.data['mobile'] = "yes"
-        elif self.data['email_mobile_status'] == "3":
-            self.data['email'] = "yes"
-            self.data['mobile'] = "yes"
-
-    def decodeddata(self):
-        # Will return data in dictionary format
-        return self.data
-
-    def signature(self):
-        # Will return the signature
-        return self.root[1][1].text
-
-    def isMobileNoRegistered(self):
-        # Will return True if mobile number is registered
-        if int(self.data['email_mobile_status']) == 3 or int(self.data['email_mobile_status']) == 1:
-            return True
-        return False
-
-    def isEmailRegistered(self):
-        # Will return True if email id is registered
-        if int(self.data['email_mobile_status']) == 3 or int(self.data['email_mobile_status']) == 2:
-            return True
-        return False
-
-    def sha256hashOfEMail(self):
-        # Will return the hash of the email id
-        return self.hashofemail
-
-    def sha256hashOfMobileNumber(self):
-        # Will return the hash of mobile number
-        return self.hashofmobile
-
-    def image(self):
-        # Will return the image stream to be used in another function
-        img = self.root[0][2].text
-        img = Image.open(BytesIO(base64.b64decode(img)))
-        return img
-
-    def saveimage(self, filename):
-        # Will save the image of user
-        image = self.image()
-        image.save(filename)
-
-    def verifyEmail(self, emailid):
-        # Will return True if emailid match with the given email id
-        generated_sha_mail = pyaadhaar.utils.SHAGenerator(
-            str(emailid)+str(self.passcode), self.data['adhaar_last_digit'])
-        if generated_sha_mail == self.sha256hashOfEMail():
-            return True
-        else:
-            return False
-
-    def verifyMobileNumber(self, mobileno):
-        # Will return True if mobileno match with the given mobile no
-        generated_sha_mobile = pyaadhaar.utils.SHAGenerator(
-            str(mobileno)+str(self.passcode), self.data['adhaar_last_digit'])
-        if generated_sha_mobile == self.sha256hashOfMobileNumber():
-            return True
-        else:
-            return False
-
diff --git a/build/lib/pyaadhaar/utils.py b/build/lib/pyaadhaar/utils.py
deleted file mode 100644
index afa1f85..0000000
--- a/build/lib/pyaadhaar/utils.py
+++ /dev/null
@@ -1,62 +0,0 @@
-from hashlib import sha256
-import pyaadhaar
-import cv2
-import numpy as np
-from pyzbar.pyzbar import decode
-
-
-def SHAGenerator(string, n):
-    # This function is to generate the hash for given emailid and mobile
-
-    # To verify mobile/email, first obtain the fourth digit of reference id (last
-    # digit of Aadhaar number). If it is 0 or 1 then converts provided Input
-    # mobile/mail id into sha256 value of provide data. In case of 2 to 9 convert
-    # the sha256 value for same number of times. This converted value should
-    # match with the value received in 8. If value not matching means
-    # mobile/email not verified.
-
-    # For more read here : https://103.57.226.101/images/resource/User_manulal_QR_Code_15032019.pdf
-
-    tmp_sha = str(string)
-    if int(n) == 0 or int(n) == 1:
-        return sha256(tmp_sha.encode()).hexdigest()
-    for i in range(int(n)):
-        tmp_sha = sha256(tmp_sha.encode()).hexdigest()
-    return tmp_sha
-
-
-def isSecureQr(sample):
-
-    # This functioin will return "True" if it is a newly release secure qr code
-    # Will return "False" if it is old adhaar qr codes
-
-    try:
-        int(sample)
-        return True
-    except ValueError:
-        return False
-
-
-def AadhaarQrAuto(data):
-
-    # This fuunction will first check the type of qrcode and will
-    # create the object of respective class and will return the oobject
-
-    if isSecureQr(data):
-        return pyaadhaar.decode.AdhaarSecureQr(int(data))
-    else:
-        return pyaadhaar.decode.AdhaarOldQr(data)
-
-
-def Qr_img_to_text(file):
-    # This function will extract all qr codes data from image
-    # And will return a list of data of all qr codes
-
-    img = cv2.imread(file)
-    gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
-    code = decode(gray)
-    totaldata = []
-    for i in code:
-        decodeddata = i.data.decode('utf-8')
-        totaldata.append(decodeddata)
-    return totaldata
diff --git a/dist/pyaadhaar-1.1.2-py3-none-any.whl b/dist/pyaadhaar-1.1.2-py3-none-any.whl
deleted file mode 100644
index 1651ff2..0000000
Binary files a/dist/pyaadhaar-1.1.2-py3-none-any.whl and /dev/null differ
diff --git a/dist/pyaadhaar-1.1.2.tar.gz b/dist/pyaadhaar-1.1.2.tar.gz
deleted file mode 100644
index 233f751..0000000
Binary files a/dist/pyaadhaar-1.1.2.tar.gz and /dev/null differ
diff --git a/dist/pyaadhaar-1.1.3-py3-none-any.whl b/dist/pyaadhaar-1.1.3-py3-none-any.whl
deleted file mode 100644
index 3e4699f..0000000
Binary files a/dist/pyaadhaar-1.1.3-py3-none-any.whl and /dev/null differ
diff --git a/dist/pyaadhaar-1.1.3.tar.gz b/dist/pyaadhaar-1.1.3.tar.gz
deleted file mode 100644
index 18342b4..0000000
Binary files a/dist/pyaadhaar-1.1.3.tar.gz and /dev/null differ
diff --git a/pyaadhaar.egg-info/PKG-INFO b/pyaadhaar.egg-info/PKG-INFO
index ffd2d73..6cf4e94 100644
--- a/pyaadhaar.egg-info/PKG-INFO
+++ b/pyaadhaar.egg-info/PKG-INFO
@@ -6,339 +6,7 @@ Home-page: https://github.com/Tanmoy741127/pyaadhaar
 Author: Tanmoy Sarkar
 Author-email: ts741127@gmail.com
 License: MIT
-Description: ## PyAadhaar Library
-        
-        ---
-        
-        #### Designed to decode Aadhaar Old QR Code , Secure QR Code and also Offline XML
-        
-        ---
-        
-        ### **`|| Decode New Adhaar Secure QR Code ||`**
-        
-        ---
-        
-        #### **`=> Initialize Object & Print Decoded Data`**
-        
-        ```
-        from pyaadhaar.decode import AadhaarSecureQr
-        
-        obj  = AadhaarSecureQr(<:Data got from QR:>)
-        print(obj.decodeddata())
-        ```
-        
-        **Output :**
-        
-        ```
-        {'email_mobile_status': '2',
-        'referenceid': '345642020107890441252',
-        'name': 'X Das',
-        'dob': '01-01-2000',
-        'gender': 'F',
-        'careof': 'C/O: Y Das',
-        'district': 'Nadia',
-        'landmark': 'Primary School',
-        'house': 'N0456',
-        'location': 'Taherpur',
-        'pincode': '741159',
-        'postoffice': 'Taherpur',
-        'state': 'West Bengal',
-        'street': 'Taherpur Road',
-        'subdistrict': 'Ranaghat - I',
-        'vtc': 'Taherpur ',
-        'adhaar_last_4_digit': '3456',
-        'adhaar_last_digit': '6',
-        'email': 'no',
-        'mobile': 'yes'}
-        ```
-        
-        #### **`=> Verify Email Id Or Mobile`**
-        
-        ```
-        print(obj.verifyEmail("example@gmail.com"))
-        print(obj.verifyMobileNumber(9999999999))
-        ```
-        
-        **Output :**
-        
-        ```
-        True  # True if Email Verified
-        False # True if Mobile Number Verified
-        ```
-        
-        #### **`=> Check for Email Id Or Mobile Registration`**
-        
-        ```
-        print(obj.isEmailRegistered("example@gmail.com"))
-        print(obj.isMobileNoRegistered(9999999999))
-        ```
-        
-        **Output :**
-        
-        ```
-        True  # True if Email Registered
-        False # True if Mobile Number Registered
-        ```
-        
-        #### **`=> Get The Image Of User`**
-        
-        ```
-        image = obj.image()
-        ```
-        
-        #### **`=> Save The Image Of User`**
-        
-        ```
-        obj.saveimage("filename.jpg")
-        ```
-        
-        #### **`=> Get SHA256 Hash of Email`**
-        
-        ```
-        print(obj.sha256hashOfEMail())
-        ```
-        
-        **Output :**
-        
-        ```
-        d5598a28a82666c7ed9978h8936851189c494c84e62ab9782492fd038d9cb328
-        ```
-        
-        #### **`=> Get SHA256 Hash of Mobile Number`**
-        
-        ```
-        print(obj.sha256hashOfMobileNumber())
-        ```
-        
-        **Output :**
-        
-        ```
-        15a79565f9f1880e94dc62de51o9j7bd08542e7a6df82081ce1e72f0fb199e69
-        ```
-        
-        ---
-        
-        ---
-        
-        ### **`|| Decode Old Adhaar QR Code ||`**
-        
-        ---
-        
-        #### **`=> Initialize Object & Print Decoded Data`**
-        
-        ```
-        from pyaadhaar.decode import AadhaarOldQr
-        
-        obj  = AadhaarOldQr(<:Data got from QR:>)
-        print(obj.decodeddata())
-        ```
-        
-        **Output :**
-        
-        ```
-        {'uid': '6XXXXXXXX789',
-         'name': 'X Sarkar',
-         'gender': 'M',
-         'yob': '2001',
-         'gname': 'Y Sarkar',
-         'street': 'TAHERPUR ROAD',
-         'lm': 'TAHERPUR',
-         'loc': '-',
-         'vtc': 'Taherpur (P)',
-         'po': 'Taherpur',
-         'dist': 'Nadia',
-         'subdist': 'Ranaghat - I',
-         'state': 'West Bengal',
-         'pc': '741159',
-         'dob': '01/01/2001'}
-        ```
-        
-        ---
-        
-        ---
-        
-        ### **`|| Decode Adhaar Offline e-KYC XML ||`**
-        
-        ---
-        
-        #### **`=> Initialize Object & Print Decoded Data`**
-        
-        ```
-        from pyaadhaar.decode import AadhaarOfflineXML
-        
-        obj  = AadhaarOfflineXML(<:Offline e-KYC XML ZIP:>,<Passcode>)
-        print(obj.decodeddata())
-        ```
-        
-        **Output :**
-        
-        ```
-        {'email_mobile_status': '2',
-        'referenceid': '345642020107890441252',
-        'name': 'X Das',
-        'dob': '01-01-2000',
-        'gender': 'F',
-        'careof': 'C/O: Y Das',
-        'district': 'Nadia',
-        'landmark': 'Primary School',
-        'house': 'N0456',
-        'location': 'Taherpur',
-        'pincode': '741159',
-        'postoffice': 'Taherpur',
-        'state': 'West Bengal',
-        'street': 'Taherpur Road',
-        'subdistrict': 'Ranaghat - I',
-        'vtc': 'Taherpur ',
-        'adhaar_last_4_digit': '3456',
-        'adhaar_last_digit': '6',
-        'email': 'no',
-        'mobile': 'yes'}
-        ```
-        
-        #### **`=> Verify Email Id Or Mobile`**
-        
-        ```
-        print(obj.verifyEmail("example@gmail.com"))
-        print(obj.verifyMobileNumber(9999999999))
-        ```
-        
-        **Output :**
-        
-        ```
-        True  # True if Email Verified
-        False # True if Mobile Number Verified
-        ```
-        
-        #### **`=> Check for Email Id Or Mobile Registration`**
-        
-        ```
-        print(obj.isEmailRegistered("example@gmail.com"))
-        print(obj.isMobileNoRegistered(9999999999))
-        ```
-        
-        **Output :**
-        
-        ```
-        True  # True if Email Registered
-        False # True if Mobile Number Registered
-        ```
-        
-        #### **`=> Get The Image Of User`**
-        
-        ```
-        image = obj.image()
-        ```
-        
-        #### **`=> Save The Image Of User`**
-        
-        ```
-        obj.saveimage("filename.jpg")
-        ```
-        
-        #### **`=> Get SHA256 Hash of Email`**
-        
-        ```
-        print(obj.sha256hashOfEMail())
-        ```
-        
-        **Output :**
-        
-        ```
-        d5598a28a82666c7ed9978h8936851189c494c84e62ab9782492fd038d9cb328
-        ```
-        
-        #### **`=> Get SHA256 Hash of Mobile Number`**
-        
-        ```
-        print(obj.sha256hashOfMobileNumber())
-        ```
-        
-        **Output :**
-        
-        ```
-        15a79565f9f1880e94dc62de51o9j7bd08542e7a6df82081ce1e72f0fb199e69
-        ```
-        
-        ---
-        
-        ---
-        
-        ### **`|| Decode Image Of QR Code ||`**
-        
-        ---
-        
-        ```
-        from pyaadhaar.utils import Qr_img_to_text
-        
-        print(Qr_img_to_text(<Image File Location or Image file stream>))
-        ```
-        
-        **Output :**
-        
-        ```
-        ["google.com","amazon.in"] # Will return a list of data
-        ```
-        
-        ---
-        
-        ---
-        
-        ### **`|| Aadhaar Auto Initialize Class On QR code Type ||`**
-        
-        ---
-        
-        #### **`=> Initialize`**
-        
-        ```
-        
-        from pyaadhaar.utils import AadhaarQrAuto
-        
-        obj = AadhaarQrAuto(<Aadhaar QR code Data >)
-        ```
-        
-        - Then all the methods are same corresponding to
-          - AadhaarOldQr
-          - AadhaarSecureQr
-        
-        ---
-        
-        ---
-        
-        ### **`|| Aadhaar Check Old or Secure QR Code||`**
-        
-        ---
-        
-        #### **`=> Initialize`**
-        
-        ```
-        from pyaadhaar.utils import isSecureQr
-        
-        print(isSecureQr(<Aadhaar QR code Data >))
-        ```
-        
-        **Output :**
-        
-        ```
-        True # If it is a new secure QR code, else False
-        ```
-        
-        ---
-        
-        ---
-        
-        # Contributors
-        
-        #### Thanks to the developer of these libraries
-        
-        - [Opencv](https://pypi.org/project/opencv-python/)
-        - [Pillow](https://pypi.org/project/Pillow/)
-        - [Libjpeg](https://pypi.org/project/pylibjpeg-libjpeg/)
-        - [Numpy](https://pypi.org/project/numpy/)
-        
-        ---
-        
 Keywords: software development aadhaar e-kyc verification
-Platform: UNKNOWN
 Classifier: Development Status :: 4 - Beta
 Classifier: Intended Audience :: Developers 
 Classifier: Topic :: Software Development :: Libraries :: Python Modules
@@ -346,3 +14,346 @@ Classifier: License :: OSI Approved :: MIT License
 Classifier: Programming Language :: Python :: 3.8
 Requires-Python: >=3.6
 Description-Content-Type: text/markdown
+
+## PyAadhaar Library
+
+---
+
+#### Designed to decode Aadhaar Old QR Code , Secure QR Code and also Offline XML
+
+---
+
+### **`|| Decode New Adhaar Secure QR Code ||`**
+
+---
+
+#### **`=> Initialize Object & Print Decoded Data`**
+
+```
+from pyaadhaar.decode import AadhaarSecureQr
+
+obj  = AadhaarSecureQr(<:Data got from QR:>)
+print(obj.decodeddata())
+```
+
+**Output :**
+
+```
+{'email_mobile_status': '2',
+'referenceid': '345642020107890441252',
+'name': 'X Das',
+'dob': '01-01-2000',
+'gender': 'F',
+'careof': 'C/O: Y Das',
+'district': 'Nadia',
+'landmark': 'Primary School',
+'house': 'N0456',
+'location': 'Taherpur',
+'pincode': '741159',
+'postoffice': 'Taherpur',
+'state': 'West Bengal',
+'street': 'Taherpur Road',
+'subdistrict': 'Ranaghat - I',
+'vtc': 'Taherpur ',
+'adhaar_last_4_digit': '3456',
+'adhaar_last_digit': '6',
+'email': 'no',
+'mobile': 'yes'}
+```
+
+#### **`=> Verify Email Id Or Mobile`**
+
+```
+print(obj.verifyEmail("example@gmail.com"))
+print(obj.verifyMobileNumber(9999999999))
+```
+
+**Output :**
+
+```
+True  # True if Email Verified
+False # True if Mobile Number Verified
+```
+
+#### **`=> Check for Email Id Or Mobile Registration`**
+
+```
+print(obj.isEmailRegistered("example@gmail.com"))
+print(obj.isMobileNoRegistered(9999999999))
+```
+
+**Output :**
+
+```
+True  # True if Email Registered
+False # True if Mobile Number Registered
+```
+
+#### **`=> Get if there exists any image in the QR CODE`**
+
+```
+image = obj.isImage()
+```
+**Output :**
+
+```
+True  # True if Image is there
+False # False if Image is not there
+```
+
+#### **`=> Get The Image Of User`**
+
+```
+image = obj.image()
+```
+
+#### **`=> Save The Image Of User`**
+
+```
+obj.saveimage("filename.jpg")
+```
+
+#### **`=> Get SHA256 Hash of Email`**
+
+```
+print(obj.sha256hashOfEMail())
+```
+
+**Output :**
+
+```
+d5598a28a82666c7ed9978h8936851189c494c84e62ab9782492fd038d9cb328
+```
+
+#### **`=> Get SHA256 Hash of Mobile Number`**
+
+```
+print(obj.sha256hashOfMobileNumber())
+```
+
+**Output :**
+
+```
+15a79565f9f1880e94dc62de51o9j7bd08542e7a6df82081ce1e72f0fb199e69
+```
+
+---
+
+---
+
+### **`|| Decode Old Adhaar QR Code ||`**
+
+---
+
+#### **`=> Initialize Object & Print Decoded Data`**
+
+```
+from pyaadhaar.decode import AadhaarOldQr
+
+obj  = AadhaarOldQr(<:Data got from QR:>)
+print(obj.decodeddata())
+```
+
+**Output :**
+
+```
+{'uid': '6XXXXXXXX789',
+ 'name': 'X Sarkar',
+ 'gender': 'M',
+ 'yob': '2001',
+ 'gname': 'Y Sarkar',
+ 'street': 'TAHERPUR ROAD',
+ 'lm': 'TAHERPUR',
+ 'loc': '-',
+ 'vtc': 'Taherpur (P)',
+ 'po': 'Taherpur',
+ 'dist': 'Nadia',
+ 'subdist': 'Ranaghat - I',
+ 'state': 'West Bengal',
+ 'pc': '741159',
+ 'dob': '01/01/2001'}
+```
+
+---
+
+---
+
+### **`|| Decode Adhaar Offline e-KYC XML ||`**
+
+---
+
+#### **`=> Initialize Object & Print Decoded Data`**
+
+```
+from pyaadhaar.decode import AadhaarOfflineXML
+
+obj  = AadhaarOfflineXML(<:Offline e-KYC XML ZIP:>,<Passcode>)
+print(obj.decodeddata())
+```
+
+**Output :**
+
+```
+{'email_mobile_status': '2',
+'referenceid': '345642020107890441252',
+'name': 'X Das',
+'dob': '01-01-2000',
+'gender': 'F',
+'careof': 'C/O: Y Das',
+'district': 'Nadia',
+'landmark': 'Primary School',
+'house': 'N0456',
+'location': 'Taherpur',
+'pincode': '741159',
+'postoffice': 'Taherpur',
+'state': 'West Bengal',
+'street': 'Taherpur Road',
+'subdistrict': 'Ranaghat - I',
+'vtc': 'Taherpur ',
+'adhaar_last_4_digit': '3456',
+'adhaar_last_digit': '6',
+'email': 'no',
+'mobile': 'yes'}
+```
+
+#### **`=> Verify Email Id Or Mobile`**
+
+```
+print(obj.verifyEmail("example@gmail.com"))
+print(obj.verifyMobileNumber(9999999999))
+```
+
+**Output :**
+
+```
+True  # True if Email Verified
+False # True if Mobile Number Verified
+```
+
+#### **`=> Check for Email Id Or Mobile Registration`**
+
+```
+print(obj.isEmailRegistered("example@gmail.com"))
+print(obj.isMobileNoRegistered(9999999999))
+```
+
+**Output :**
+
+```
+True  # True if Email Registered
+False # True if Mobile Number Registered
+```
+
+#### **`=> Get The Image Of User`**
+
+```
+image = obj.image()
+```
+
+#### **`=> Save The Image Of User`**
+
+```
+obj.saveimage("filename.jpg")
+```
+
+#### **`=> Get SHA256 Hash of Email`**
+
+```
+print(obj.sha256hashOfEMail())
+```
+
+**Output :**
+
+```
+d5598a28a82666c7ed9978h8936851189c494c84e62ab9782492fd038d9cb328
+```
+
+#### **`=> Get SHA256 Hash of Mobile Number`**
+
+```
+print(obj.sha256hashOfMobileNumber())
+```
+
+**Output :**
+
+```
+15a79565f9f1880e94dc62de51o9j7bd08542e7a6df82081ce1e72f0fb199e69
+```
+
+---
+
+---
+
+### **`|| Decode Image Of QR Code ||`**
+
+---
+
+```
+from pyaadhaar.utils import Qr_img_to_text
+
+print(Qr_img_to_text(<Image File Location or Image file stream>))
+```
+
+**Output :**
+
+```
+["google.com","amazon.in"] # Will return a list of data
+```
+
+---
+
+---
+
+### **`|| Aadhaar Auto Initialize Class On QR code Type ||`**
+
+---
+
+#### **`=> Initialize`**
+
+```
+
+from pyaadhaar.utils import AadhaarQrAuto
+
+obj = AadhaarQrAuto(<Aadhaar QR code Data >)
+```
+
+- Then all the methods are same corresponding to
+  - AadhaarOldQr
+  - AadhaarSecureQr
+
+---
+
+---
+
+### **`|| Aadhaar Check Old or Secure QR Code||`**
+
+---
+
+#### **`=> Initialize`**
+
+```
+from pyaadhaar.utils import isSecureQr
+
+print(isSecureQr(<Aadhaar QR code Data >))
+```
+
+**Output :**
+
+```
+True # If it is a new secure QR code, else False
+```
+
+---
+
+---
+
+# Contributors
+
+#### Thanks to the developer of these libraries
+
+- [Opencv](https://pypi.org/project/opencv-python/)
+- [Pillow](https://pypi.org/project/Pillow/)
+- [Libjpeg](https://pypi.org/project/pylibjpeg-libjpeg/)
+- [Numpy](https://pypi.org/project/numpy/)
+
+---
diff --git a/pyaadhaar.egg-info/SOURCES.txt b/pyaadhaar.egg-info/SOURCES.txt
index 33aa720..e6ffcf0 100644
--- a/pyaadhaar.egg-info/SOURCES.txt
+++ b/pyaadhaar.egg-info/SOURCES.txt
@@ -1,7 +1,7 @@
 setup.py
 pyaadhaar/__init__.py
 pyaadhaar/decode.py
-pyaadhaar/tests.py
+pyaadhaar/test.py
 pyaadhaar/utils.py
 pyaadhaar.egg-info/PKG-INFO
 pyaadhaar.egg-info/SOURCES.txt
diff --git a/pyaadhaar/__pycache__/decode.cpython-38.pyc b/pyaadhaar/__pycache__/decode.cpython-38.pyc
deleted file mode 100644
index 66124e3..0000000
Binary files a/pyaadhaar/__pycache__/decode.cpython-38.pyc and /dev/null differ
diff --git a/pyaadhaar/decode.py b/pyaadhaar/decode.py
index 5366478..3789810 100644
--- a/pyaadhaar/decode.py
+++ b/pyaadhaar/decode.py
@@ -7,6 +7,7 @@
 import base64
 import zipfile
 import pyaadhaar
+from typing import Union
 
 
 class AadhaarSecureQr:
@@ -15,7 +16,7 @@ class AadhaarSecureQr:
     # This class now supports 2022 version of Aadhaar QR codes [version-2]
     # For more information check here : https://103.57.226.101/images/resource/User_manulal_QR_Code_15032019.pdf
 
-    def __init__(self, base10encodedstring):
+    def __init__(self, base10encodedstring:str) -> None:
         self.base10encodedstring = base10encodedstring
         self.details = ["version","email_mobile_status","referenceid", "name", "dob", "gender", "careof", "district", "landmark",
                         "house", "location", "pincode", "postoffice", "state", "street", "subdistrict", "vtc", "last_4_digits_mobile_no"]
@@ -26,25 +27,26 @@ def __init__(self, base10encodedstring):
         self._create_delimeter()
         self._extract_info_from_decompressed_array()
 
-    def _convert_base10encoded_to_decompressed_array(self):
-        # This function converts base10encoded string to a decompressed array
+    # Converts base10encoded string to a decompressed array
+    def _convert_base10encoded_to_decompressed_array(self) -> None:
         bytes_array = self.base10encodedstring.to_bytes(5000, 'big').lstrip(b'\x00')
-        self.decompressed_array = zlib.decompress(
-            bytes_array, 16+zlib.MAX_WBITS)
+        self.decompressed_array = zlib.decompress(bytes_array, 16+zlib.MAX_WBITS)
 
-    def _check_aadhaar_version(self):
-        # This function will check for the new 2022 version-2 Aadhaar QRs
-        # If not found it will remove the "version" key from self.details, Defaulting to normal Secure QRs
+    # This function will check for the new 2022 version-2 Aadhaar QRs
+    # If not found it will remove the "version" key from self.details, Defaulting to normal Secure QRs
+    def _check_aadhaar_version(self) -> None:
         if self.decompressed_array[:2].decode("ISO-8859-1") != 'V2':
             self.details.pop(0) # Removing "Version"
             self.details.pop() # Removing "Last_4_digits_of_mobile_no"
-    def _create_delimeter(self):
-        # This function creates the delimeter which is used to extract the information from the decompressed array
+
+    # Creates the delimeter which is used to extract the information from the decompressed array
+    def _create_delimeter(self) -> None:
         for i in range(len(self.decompressed_array)):
             if self.decompressed_array[i] == 255:
                 self.delimeter.append(i)
 
-    def _extract_info_from_decompressed_array(self):
+    # Extracts the information from the decompressed array
+    def _extract_info_from_decompressed_array(self) -> None:
         for i in range(len(self.details)):
             self.data[self.details[i]] = self.decompressed_array[self.delimeter[i] + 1:self.delimeter[i+1]].decode("ISO-8859-1")
         self.data['adhaar_last_4_digit'] = self.data['referenceid'][:4]
@@ -58,36 +60,37 @@ def _extract_info_from_decompressed_array(self):
         if int(self.data['email_mobile_status']) in {3, 2}:
             self.data['mobile'] = True
 
-    def decodeddata(self):
-        # Will return the personal data in a dictionary format
+    # Returns the extracted data in a dictionary format
+    def decodeddata(self) -> dict:
         return self.data
 
-    def signature(self):
+    # Returns signature of the QR code
+    def signature(self) -> bytes:
         return self.decompressed_array[len(self.decompressed_array) - 256 :]
 
-    def signedData(self):
+    # Returns the signed data of the QR code
+    def signedData(self) -> bytes:
         return self.decompressed_array[:len(self.decompressed_array)-256]
 
-    def isMobileNoRegistered(self):
-        # Will return True if mobile number is registered
+    # Check whether mobile no is registered or not
+    def isMobileNoRegistered(self) -> bool:
         return self.data['mobile']
 
-    def isEmailRegistered(self):
-        # Will return True if email id is registered
+    # Check whether email id is registered or not
+    def isEmailRegistered(self) -> bool:
         return self.data['email']
 
-    def sha256hashOfEMail(self):
-        # Will return the hash of the email id
+    # Return hash of the email id
+    def sha256hashOfEMail(self) -> str:
         tmp = ""
         if int(self.data['email_mobile_status']) == 3:
-            tmp = self.decompressed_array[len(
-                self.decompressed_array)-256-32-32:len(self.decompressed_array)-256-32].hex()
+            tmp = self.decompressed_array[len(self.decompressed_array)-256-32-32:len(self.decompressed_array)-256-32].hex()
         elif int(self.data['email_mobile_status']) == 1:
-            tmp = self.decompressed_array[len(
-                self.decompressed_array)-256-32:len(self.decompressed_array)-256].hex()
+            tmp = self.decompressed_array[len(self.decompressed_array)-256-32:len(self.decompressed_array)-256].hex()
         return tmp
 
-    def sha256hashOfMobileNumber(self):
+    # Return hash of the mobile number
+    def sha256hashOfMobileNumber(self) -> str:
         return (
             self.decompressed_array[
                 len(self.decompressed_array)
@@ -99,8 +102,8 @@ def sha256hashOfMobileNumber(self):
             else ""
         )
 
+    # Check availability of image in the QR CODE
     def isImage(self, buffer = 10) -> bool:
-        # Will return bool for availability of image stream in the QR CODE
         if int(self.data['email_mobile_status']) == 3:
             return (
                 len(
@@ -128,9 +131,9 @@ def isImage(self, buffer = 10) -> bool:
                 )
                 >= 256 + buffer
             )
-            
-    def image(self):
-        # Will return the image stream to be used in another function
+    
+    # Return image stream
+    def image(self) -> Union[Image.Image,None]:
         if int(self.data['email_mobile_status']) == 3:
             return Image.open(
                 BytesIO(
@@ -158,22 +161,24 @@ def image(self):
         else:
             return None
 
-    def saveimage(self, filename):
-        # Will save the image of user
+    # Save the image of the user
+    def saveimage(self, filepath:str) -> None:
         image = self.image()
         image.load()
-        image.save(filename)
+        image.save(filepath)
 
-    def verifyEmail(self, emailid):
-        # Will return True if emailid match with the given email id
-        generated_sha_mail = pyaadhaar.utils.SHAGenerator(
-            emailid, self.data['adhaar_last_digit'])
+    # Verify the email id
+    def verifyEmail(self, emailid:str) -> bool:
+        if type(emailid) != str:
+            raise TypeError("Email id should be string")
+        generated_sha_mail = pyaadhaar.utils.SHAGenerator(emailid, self.data['adhaar_last_digit'])
         return generated_sha_mail == self.sha256hashOfEMail()
 
-    def verifyMobileNumber(self, mobileno):
-        # Will return True if mobileno match with the given mobile no
-        generated_sha_mobile = pyaadhaar.utils.SHAGenerator(
-            mobileno, self.data['adhaar_last_digit'])
+    # Verify the mobile no  
+    def verifyMobileNumber(self, mobileno:str) -> bool:
+        if type(mobileno) != str:
+            raise TypeError("Mobile number should be string")
+        generated_sha_mobile = pyaadhaar.utils.SHAGenerator(mobileno, self.data['adhaar_last_digit'])
         return generated_sha_mobile == self.sha256hashOfMobileNumber()
 
 
@@ -181,13 +186,13 @@ class AadhaarOldQr:
     # This is the class for Adhaar Normal Qr code..  In this version of code the data is in XML v1.0 format
     # For more information check here : https://103.57.226.101/images/resource/User_manulal_QR_Code_15032019.pdf
 
-    def __init__(self, qrdata):
+    def __init__(self, qrdata) -> None:
         self.qrdata = qrdata
         self.xmlparser = ET.XMLParser(encoding="utf-8")
         self.parsedxml = ET.fromstring(qrdata, parser=self.xmlparser)
         self.data = self.parsedxml.attrib
 
-    def decodeddata(self):
+    def decodeddata(self) -> dict:
         # Will return the decoded datas inn dictionary format
         return self.data
 
@@ -198,7 +203,7 @@ class AadhaarOfflineXML:
     # The special thing of Offline XML is that we can extract the high quality photo of user from the data
     # For more information check here : https://103.57.226.101/images/resource/User_manulal_QR_Code_15032019.pdf
 
-    def __init__(self, file, passcode):
+    def __init__(self, file:str, passcode:str) -> None:
         # Need to pass the zip file and passcode/sharecode to this function
         self.passcode = passcode
         self.data = {}
@@ -240,58 +245,65 @@ def __init__(self, file, passcode):
         self.data['adhaar_last_digit'] = self.data['referenceid'][3]
 
         if self.data['email_mobile_status'] == "0":
-            self.data['email'] = "no"
-            self.data['mobile'] = "no"
+            self.data['email'] = False
+            self.data['mobile'] = False
         elif self.data['email_mobile_status'] == "1":
-            self.data['email'] = "yes"
-            self.data['mobile'] = "no"
+            self.data['email'] = True
+            self.data['mobile'] = False
         elif self.data['email_mobile_status'] == "2":
-            self.data['email'] = "no"
-            self.data['mobile'] = "yes"
+            self.data['email'] = False
+            self.data['mobile'] = True
         elif self.data['email_mobile_status'] == "3":
-            self.data['email'] = "yes"
-            self.data['mobile'] = "yes"
+            self.data['email'] = True
+            self.data['mobile'] = True
 
-    def decodeddata(self):
-        # Will return data in dictionary format
+    # Get decoded data in dictionary format
+    def decodeddata(self) -> dict:
         return self.data
 
-    def signature(self):
-        # Will return the signature
+    # Fetch signature
+    def signature(self) -> str:
         return self.root[1][1].text
 
-    def isMobileNoRegistered(self):
+    # Check if mobile number is registered
+    def isMobileNoRegistered(self) -> bool:
         # Will return True if mobile number is registered
         if int(self.data['email_mobile_status']) == 3 or int(self.data['email_mobile_status']) == 1:
             return True
         return False
 
-    def isEmailRegistered(self):
+    # Check if email id is registered
+    def isEmailRegistered(self) -> bool:
         # Will return True if email id is registered
         if int(self.data['email_mobile_status']) == 3 or int(self.data['email_mobile_status']) == 2:
             return True
         return False
 
-    def sha256hashOfEMail(self):
+    # Get the hash of email id
+    def sha256hashOfEMail(self) -> str:
         # Will return the hash of the email id
         return self.hashofemail
 
-    def sha256hashOfMobileNumber(self):
+    # Get the hash of mobile number
+    def sha256hashOfMobileNumber(self) -> str:
         # Will return the hash of mobile number
         return self.hashofmobile
 
-    def image(self):
+    # Get the image of user
+    def image(self) -> Image.Image:
         # Will return the image stream to be used in another function
         img = self.root[0][2].text
         img = Image.open(BytesIO(base64.b64decode(img)))
         return img
 
-    def saveimage(self, filename):
+    # Save the image of user
+    def saveimage(self, filepath:str) -> None:
         # Will save the image of user
         image = self.image()
-        image.save(filename)
+        image.save(filepath)
 
-    def verifyEmail(self, emailid):
+    # Verify the email id
+    def verifyEmail(self, emailid:str) -> bool:
         # Will return True if emailid match with the given email id
         generated_sha_mail = pyaadhaar.utils.SHAGenerator(
             str(emailid)+str(self.passcode), self.data['adhaar_last_digit'])
@@ -300,12 +312,11 @@ def verifyEmail(self, emailid):
         else:
             return False
 
-    def verifyMobileNumber(self, mobileno):
+    # Verify the mobile number
+    def verifyMobileNumber(self, mobileno:str) -> bool:
         # Will return True if mobileno match with the given mobile no
-        generated_sha_mobile = pyaadhaar.utils.SHAGenerator(
-            str(mobileno)+str(self.passcode), self.data['adhaar_last_digit'])
+        generated_sha_mobile = pyaadhaar.utils.SHAGenerator(str(mobileno)+str(self.passcode), self.data['adhaar_last_digit'])
         if generated_sha_mobile == self.sha256hashOfMobileNumber():
             return True
         else:
-            return False
-
+            return False
\ No newline at end of file
diff --git a/setup.py b/setup.py
index 46bd3c9..1374d0a 100644
--- a/setup.py
+++ b/setup.py
@@ -6,7 +6,7 @@
 setup(
     name='pyaadhaar',
     packages=find_packages(),
-    version='1.1.3',
+    version='2.0.0',
     description='This library is built to ease the process of decoding aadhaar QR codes and XML. It supprts old aadhaar QR codes , newly released Secure aadhaar QR codes and also Offline e-KYC XML. This library also can decode QR codes with Opncv. This library bundled with all the features to verify user\'s Email Id and Mobile Number & also to extract the photo of user. ',
     long_description=long_description,
     long_description_content_type="text/markdown",


Test patch:
diff --git a/build/lib/pyaadhaar/tests.py b/build/lib/pyaadhaar/tests.py
deleted file mode 100644
index 7e11968..0000000
--- a/build/lib/pyaadhaar/tests.py
+++ /dev/null
@@ -1,24 +0,0 @@
-from pdf2image import convert_from_path
-from pyzbar.pyzbar import decode
-from decode import AadhaarSecureQr
-
-filename = '/home/arkajit/Documents/Projects/pyaadhaar_updated/test_files/Test_Aadhar_Arkajit.pdf'
-working_file = '/home/arkajit/Downloads/new_aadhaar_pvc_4.pdf'
-pages = convert_from_path(filename)
-
-scale = 2
-extracted_info = []
-for page_idx,page in enumerate(pages):
-    page.save(f"{filename[:-4]}_page{page_idx+1}.png")
-    page = page.resize((page.width*scale, page.height*scale))
-    print(decode(page))
-    extracted_info.append(decode(page))
-
-temp = extracted_info[0]
-obj = AadhaarSecureQr(int(temp[0].data))
-extracted_fields = obj.decodeddata()
-print(extracted_fields)
-print(obj.signature())
-print("---------------------")
-print(obj.signedData())
-obj.saveimage("/home/arkajit/Documents/Projects/pyaadhaar_updated/test_files/test.png")