Pyyhon encryption code - Help me understand the logic of a Python code which has some encryption logic in it
<p>I have a python code. I am pretty new to python. could some one please explain what this piece of code dose. </p>

<p>From what I can understand this piece of code is trying to decry-pt the ID's.
We pass in the ID's with a CSV file. I am unable to understand the logic line by line. Specially the hashfn.hexdigest and insert lines</p>

<pre><code>import csv
import hashlib
seed_val = b'197504'
outfile = open('ID_nos_hashed.csv','a')
with open('ID_nos_input.csv', 'rb') as infile:
  for inline in infile.readlines():
    linearray = inline.split(',')
    first_item = linearray[0]
    hashfn = hashlib.sha1()
    hashfn.update(first_item)
    hashfn.update(seed_val)
    lc_num_hash = hashfn.hexdigest()
    uc_num_hash = lc_num_hash.upper()
    insert_list = []
    insert_list.append(first_item)
    insert_list.append(uc_num_hash)
    insert_string = ','.join(insert_list)+'\n'
    outfile.write(insert_string)
infile.close()
outfile.close()
</code></pre>