MCPcopy
hub / github.com/TheAlgorithms/Python / remove_prefix

Function remove_prefix

data_compression/lempel_ziv_decompress.py:84–97  ·  view source on GitHub ↗

Removes size prefix, that compressed file should have Returns the result

(data_bits: str)

Source from the content-addressed store, hash-verified

82
83
84def remove_prefix(data_bits: str) -> str:
85 """
86 Removes size prefix, that compressed file should have
87 Returns the result
88 """
89 counter = 0
90 for letter in data_bits:
91 if letter == "1":
92 break
93 counter += 1
94
95 data_bits = data_bits[counter:]
96 data_bits = data_bits[counter + 1 :]
97 return data_bits
98
99
100def compress(source_path: str, destination_path: str) -> None:

Callers 1

compressFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected