title: I wrote a program for finding password from hash, and i have some hashes, but it writes just the last row. what is the problem
body: <pre><code>from hashlib import sha256
  import csv
  
  with open ('source.csv', 'r' ) as file:
      reader = csv.reader ( file )
  
      dic = {}
      for hash in range ( 1000, 10000):
          hasher = sha256 ( b'%i' % hash ).hexdigest ()
          hash = dic [ hasher ] = hash
  
      for row in reader:
          name = row [ 0 ] 
          for key in row [ 1: ]:
              hack = ( name, dic [ key ] )
  
          for r in hack:
              with open ( 'out.csv', 'w', newline = '' ) as out:
                  writer = csv.writer ( out )
                  writer.writerow ( hack )
  </code></pre>
  <p>my write is:</p>
  <pre><code>peter,5104
  </code></pre>
  <p>write should be like this:</p>
  <pre><code>alex,2218
  emma,4215
  peter,5104
  </code></pre>