title: how to convert to the same format hashlib.sha256((s + f'{pin}'.rjust(4,"0")+".").encode()).hexdigest()
body: <p>how to convert to the same format
  hashlib.sha256((s + f'{pin}'.rjust(4,&quot;0&quot;)+&quot;.&quot;).encode()).hexdigest() == s &quot;Bank SunBank. Src: 2445-5900-1167, Dest: 2445-5833-9378, Amount: 12000 $, PIN: &quot;</p>
  <pre><code>def displayBytes64(bytes):          
  #bytes это BankPayRequest.enc
  ss = []
  ssha = []
  pin = 0
  s = &quot;Bank SunBank. Src: 2445-5900-1167, Dest: 2445-5833-9378, Amount: 12000 $, PIN: &quot;
  #отделяем sha256(R) из файла
  for i in range ((len(bytes)-64), len(bytes)):
      ss.append(bytes[i])
  # ss это R из BankPayRequest.enc    
  
  # Подбираем пароль сравнивая с sha256 R
  while pin &lt;= 9999: 
      ssha = hashlib.sha256((s + f'{pin}'.rjust(4,&quot;0&quot;)+&quot;.&quot;).encode()).hexdigest()
      
      if ssha == ss:
          print(pin)
          break
      else:
          print(ssha)
          for index, item in enumerate(ss,start=1):
              print(f'{index} = {item} ({hex(item)})')
        
          pin += 1 
  </code></pre>