M1-PCA-Project/source/models/Proof.py

19 lines
No EOL
414 B
Python

from dataclasses import dataclass
from datetime import datetime
import struct
@dataclass
class Proof:
date: datetime
public_key_votant: bytes
public_key_mandataire: bytes
proof_signature: bytes
def to_bytes(self):
struct.pack("<d...", self.date.timestamp(), self.public_key_votant, self.public_key_mandataire)
#bytes(str(ici), 'utf-8')
bytes(self.date.timestamp())