What is Nostr?
SB1
npub1rn5…hmm0
2023-01-18 15:56:32
in reply to nevent1q…vgx2

SB1 on Nostr: Here the py ``` import hashlib import bech32 # Read the file data with open(filename, ...

Here the py
```
import hashlib
import bech32

# Read the file data
with open(filename, 'rb') as f:
data = f.read()

# Calculate the SHA-256 hash of the file data
hash = hashlib.sha256(data).hexdigest()

# Serialize the list of Bech32-encoded public keys
serialized_names = []
for name in names:
# Convert the key to bytes
key_bytes = bech32.decode(name)
# Append the key to the list of serialized names
serialized_names.append(key_bytes)

# Concatenate the inputs and the serialized names with the file data
concatenated_data = bytes.fromhex(A) + data + b''.join(serialized_names)

# Calculate the SHA-256 hash of the concatenated data
final_hash = hashlib.sha256(concatenated_data).hexdigest()

# Compare the final hash with the Result
proof = final_hash == Result

# Calculate the n-times hashed final hash
n_times_hashed = final_hash
for i in range(n):
n_times_hashed = hashlib.sha256(bytes.fromhex(n_times_hashed)).hexdigest()

# Output the hashes
print("Data Hash:", hash)
print("Final Hash:", final_hash)
print("Proof:", proof)
print(f"{n} times hashed final hash: {n_times_hashed}")

```
Author Public Key
npub1rn5gxkw9dhj6xh82jsfarwvterknaqmzcqjxn04tvpj0mrtw36hqc8hmm0