Is Base64 encoding safe to use for filenames on Windows and Linux systems? From my research I have found that replacing all /
characters of the result with
Usually MD5 hashes (hashes in general) are represented as hexadecimal strings instead of Base64, which then only contain [a-f0-9]. Those names would be supported by all filesystems.
If you really want to use Base64, your solution (replacing slashes) will not work correctly as Windows filesystems don't make a difference between 'A' and 'a'. Maybe you want to use Base32 instead? But mind that Base32 makes 8 bits out of 4, so it will be easier to just take the hexadecimal representation.
In general, the following characters are not allowed in Windows and/or Linux: \ / : * ? " < > |