-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #253 from stratosphereips/send-config-file-id-to-a…
…gent Send config file id to agent
- Loading branch information
Showing
3 changed files
with
26 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
# Utility functions for then env and for the agents | ||
# Author: Sebastian Garcia. [email protected] | ||
# Author: Ondrej Lukas, [email protected] | ||
#import configparser | ||
import yaml | ||
import sys | ||
|
@@ -16,6 +17,19 @@ | |
import csv | ||
from random import randint | ||
import json | ||
import hashlib | ||
|
||
def get_file_hash(filepath, hash_func='sha256', chunk_size=4096): | ||
""" | ||
Computes hash of a given file. | ||
""" | ||
hash_algorithm = hashlib.new(hash_func) | ||
with open(filepath, 'rb') as file: | ||
chunk = file.read(chunk_size) | ||
while chunk: | ||
hash_algorithm.update(chunk) | ||
chunk = file.read(chunk_size) | ||
return hash_algorithm.hexdigest() | ||
|
||
def read_replay_buffer_from_csv(csvfile:str)->list: | ||
""" | ||
|