You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: header_ecc.py
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -514,8 +514,8 @@ def main(argv=None):
514
514
header_size_add=header_size
515
515
else: # else for size smaller than the defined header size, it will just be the size of the file
516
516
header_size_add=size
517
-
# Size of the ecc entry for this file will be: marker-bytes (\xFF bytes) + length-filepath-string + length-size-string + size of the ecc per block for all blocks in file header + size of the hash per block for all blocks in file header.
518
-
sizeheaders=sizeheaders+replication_rate* (len(entrymarker) +len(field_delim)*2+len(relfilepath) +len(str(size)) + (int(math.ceil(float(header_size_add) /ecc_params["message_size"])) * (ecc_params["ecc_size"]+ecc_params["hash_size"])) ) # Compute the total number of bytes we will add with ecc + hash (accounting for the padding of the remaining characters at the end of the sequence in case it doesn't fit with the message_size, by using ceil() )
517
+
# Size of the ecc entry for this file will be: entrymarker-bytes + field_delim-bytes*occurrence + length-filepath-string + length-size-string + length-filepath-ecc + size of the ecc per block for all blocks in file header + size of the hash per block for all blocks in file header.
518
+
sizeheaders=sizeheaders+replication_rate* (len(entrymarker) +len(field_delim)*3+len(relfilepath) +len(str(size)) +int(float(len(relfilepath))*resilience_rate_intra) + (int(math.ceil(float(header_size_add) /ecc_params["message_size"])) * (ecc_params["ecc_size"]+ecc_params["hash_size"])) ) # Compute the total number of bytes we will add with ecc + hash (accounting for the padding of the remaining characters at the end of the sequence in case it doesn't fit with the message_size, by using ceil() )
519
519
ptee.write("Precomputing done.")
520
520
# TODO: add the size of the ecc format header? (arguments string + PYHEADERECC identifier)
Copy file name to clipboardExpand all lines: structural_adaptive_ecc.py
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -557,8 +557,8 @@ def main(argv=None):
557
557
else: # else for size smaller than the defined header size, it will just be the size of the file
558
558
filesize_header=size
559
559
filesize_content=0
560
-
# Size of the ecc entry for this file will be: marker-bytes (\xFF bytes) + length-filepath-string + length-size-string + size of the ecc per block for all blocks in file header + size of the hash per block for all blocks in file header.
561
-
sizeecc+=replication_rate* (len(entrymarker) +len(field_delim)*2+len(relfilepath) +len(str(size)) + (int(math.ceil(float(filesize_header) /ecc_params_header["message_size"])) * (ecc_params_header["ecc_size"]+ecc_params_header["hash_size"])) + (int(math.ceil(float(filesize_content) /ecc_params_variable_average["message_size"])) * (ecc_params_variable_average["ecc_size"]+ecc_params_variable_average["hash_size"])) ) # Compute the total number of bytes we will add with ecc + hash (accounting for the padding of the remaining characters at the end of the sequence in case it doesn't fit with the message_size, by using ceil() )
560
+
# Size of the ecc entry for this file will be: entrymarker-bytes + field_delim-bytes*occurrence + length-filepath-string + length-size-string + length-filepath-ecc + size of the ecc per block for all blocks in file header + size of the hash per block for all blocks in file header.
561
+
sizeecc+=replication_rate* (len(entrymarker) +len(field_delim)*3+len(relfilepath) +len(str(size)) +int(float(len(relfilepath))*resilience_rate_intra) + (int(math.ceil(float(filesize_header) /ecc_params_header["message_size"])) * (ecc_params_header["ecc_size"]+ecc_params_header["hash_size"])) + (int(math.ceil(float(filesize_content) /ecc_params_variable_average["message_size"])) * (ecc_params_variable_average["ecc_size"]+ecc_params_variable_average["hash_size"])) ) # Compute the total number of bytes we will add with ecc + hash (accounting for the padding of the remaining characters at the end of the sequence in case it doesn't fit with the message_size, by using ceil() )
562
562
ptee.write("Precomputing done.")
563
563
ifgenerate: # show statistics only if generating an ecc file
564
564
# TODO: add the size of the ecc format header? (arguments string + PYHEADERECC identifier)
0 commit comments