חזור לתיקייה: גליון 1

Transaction

חיפוש בתיקיה
Ctrl K
לחץ כאן או הקש Ctrl K כדי לחפש בכל התיקיה

    Transaction

    02340124

    מבוא לתכנות מערכות

    רשימות הרצאה לקריאה בשבת

    Transaction

    הופק מתוך תקיית התואר של שקד

    uni-folder.vercel.app

    transaction.cpp

    הערה (קובץ קוד)

    קובץ זה הוא קובץ קוד מסוג CPP.

    #include <stdio.h>
    
    #include "Transaction.h"
    #include "Utilities.h"
    
    void TransactionDumpInfo(const Transaction& transaction, ofstream& file)
    {
        file << "Sender Name: " << transaction.sender << std::endl;
        file << "Receiver Name: " << transaction.receiver << std::endl;
        file << "Transaction Value: " << transaction.value << std::endl;
    }
    
    string TransactionHashedMessage(const Transaction& transaction)
    {
        return hash(
            transaction.value,
            transaction.sender,
            transaction.receiver
        );
    }
    
    bool TransactionVerifyHashedMessage(
            const Transaction& transaction,
            string hashedMessage
    )
    {
        string supposedToBe = TransactionHashedMessage(transaction);
    
        return (hashedMessage == supposedToBe);
    }