mirror of
https://github.com/cedricbonhomme/Stegano.git
synced 2025-05-12 17:18:30 +02:00
clean code related to tools.binary2base64 and tools.base642binary functions.
This commit is contained in:
parent
190f790e50
commit
263e287559
1 changed files with 0 additions and 12 deletions
|
@ -91,24 +91,12 @@ def binary2base64(binary_file):
|
||||||
fin = open(binary_file, "rb")
|
fin = open(binary_file, "rb")
|
||||||
binary_data = fin.read()
|
binary_data = fin.read()
|
||||||
fin.close()
|
fin.close()
|
||||||
|
|
||||||
# Encode binary to base64 string (printable)
|
# Encode binary to base64 string (printable)
|
||||||
return base64.b64encode(binary_data)
|
return base64.b64encode(binary_data)
|
||||||
|
|
||||||
"""fout = open(output_file, "w")
|
|
||||||
fout.write(b64_data)
|
|
||||||
fout.close"""
|
|
||||||
|
|
||||||
def base642binary(b64_fname):
|
def base642binary(b64_fname):
|
||||||
"""
|
"""
|
||||||
Convert a printable file to a binary file.
|
Convert a printable file to a binary file.
|
||||||
"""
|
"""
|
||||||
# Read base64 string
|
|
||||||
#fin = open(b64_fname, "r")
|
|
||||||
#b64_str = fin.read()
|
|
||||||
#fin.close()
|
|
||||||
# Decode base64 string to original binary sound object
|
|
||||||
b64_fname += b'==='
|
b64_fname += b'==='
|
||||||
return base64.decodestring(b64_fname)
|
return base64.decodestring(b64_fname)
|
||||||
|
|
||||||
#return base64.b64decode(b64_fname)
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue