python - convert large binary file to hexadecimal (binascii.hexlify returns MemoryError) -


i trying convert large file (~1gb) hexadecimal string binascii (which works great on smaller files), causing memoryerror.

this code using:

import binascii  filepath = "demo/11.mp4.zip"  file = open(filepath, "rb") file:     byte = file.read()     hexa = binascii.hexlify(byte)  hexa_string = hexa.decode('ascii'); 

any advice?

actually approximately using 3 gb of memory storing file , hex within byte , hexa variables, instead of can iterate within file , process based on chunks .


Comments

Popular posts from this blog

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -