UDPFile_sender.py
def MESSAGE_hash(self, hash):
        ''' This function returns byte array of full message
        to be sent as response to ~ file exists in server file system '''
        
        ## Write header
        header = self.get_empty_header(header_byte_size=self.header_size)
        header[0] = ord(str(MESSAGE_TYPES['file_hash']))
        
        ## Write body
        body = self.get_empty_body(body_byte_size=FILE_DATA_HASH_MESSAGE_BODY_SIZE)
        # Write hash into the body
        for hash_byte_val_idx in range(HASH_LENGTH):
            body[hash_byte_val_idx] = hash[hash_byte_val_idx]
        
        # Write in crc at the end of the body
        message_without_crc = np.concatenate((header, body), axis=None)
        message_with_crc = append_crc_to_message(message_without_crc)
        
        return message_with_crc
 This function returns byte array of full message
        to be sent as response to ~ file exists in server file system 
This function returns byte array of full message
to be sent as response to ~ file exists in server file system
This function returns byte array of full message to be sent as response to ~ file exists in server file system
def MESSAGE_hash(self, hash):
        header = self.get_empty_header(header_byte_size=self.header_size)
        header[0] = ord(str(MESSAGE_TYPES['file_hash']))
        body = self.get_empty_body(body_byte_size=FILE_DATA_HASH_MESSAGE_BODY_SIZE)
        for hash_byte_val_idx in range(HASH_LENGTH):
            body[hash_byte_val_idx] = hash[hash_byte_val_idx]
        message_without_crc = np.concatenate((header, body), axis=None)
        message_with_crc = append_crc_to_message(message_without_crc)
        return message_with_crc
def MESSAGE_hash ( self , hash ) : header = self . get_empty_header ( header_byte_size = self . header_size ) header [ 0 ] = ord ( str ( MESSAGE_TYPES [ 'file_hash' ] ) ) body = self . get_empty_body ( body_byte_size = FILE_DATA_HASH_MESSAGE_BODY_SIZE ) for hash_byte_val_idx in range ( HASH_LENGTH ) : body [ hash_byte_val_idx ] = hash [ hash_byte_val_idx ] message_without_crc = np . concatenate ( ( header , body ) , axis = None ) message_with_crc = append_crc_to_message ( message_without_crc ) return message_with_crc
This function returns byte array of full message
to be sent as response to ~ file exists in server file system
This function returns byte array of full message to be sent as response to ~ file exists in server file system
''' This function returns byte array of full message
        to be sent as response to ~ file exists in server file system ''' ## Write header
 ## Write body
 # Write hash into the body
 # Write in crc at the end of the body

self
hash