mirror of
https://github.com/lnbits/lnbits-legend.git
synced 2025-02-24 14:51:05 +01:00
15 lines
317 B
Python
15 lines
317 B
Python
from hashlib import sha256
|
|
from typing import NamedTuple
|
|
|
|
|
|
class Paywall(NamedTuple):
|
|
id: str
|
|
wallet: str
|
|
secret: str
|
|
url: str
|
|
memo: str
|
|
amount: int
|
|
time: int
|
|
|
|
def key_for(self, fingerprint: str) -> str:
|
|
return sha256(f"{self.secret}{fingerprint}".encode("utf-8")).hexdigest()
|