4 ms·
If you do not want to install a npm package for this you can use tar -cv file | base64 It also supports compression! tar -cv --gzip file | base64 Sadly
by h_anna_h 6y ago
If you do not want to install a npm package for this you can use
tar -cv file | base64
It also supports compression!
tar -cv --gzip file | base64
Sadly it is not human readable, unlike this utility.
- nabla9 6y agoIf it needs to be plain text there shar command (shell archieve). It was used to send text file attachments.
- icedchai 6y ago"uuencode" was also used in the Usenet days.
- chrissnell 6y ago^ this I remember telnet-based installers back in the early 1990s that used the pipe-to-sh truck along with shar archives to install things like IRC clients onto your workstation.
- mappu 6y agoTar files are human readable - file names, sizes, mtime and so on are all in ASCII text numerals, immediately preceding each file's content. Maybe not human writable, there are some \x00 bytes used for padding.
- h_anna_h 6y agoInteresting, I would really not expect sizes and time to be in ASCII. I wonder their reasoning was.
- mbreese 6y agoDebugging text is easier and the bulk of the data is binary anyway, so there would be no great file savings with a "pure" binary protocol. That's the same rationale for HTML and text-based internet protocols -- they are easier to write and debug. This is a particular concern when you're talking about a file format that has to work on wide variety of architectures and operating systems. Having a common ASCII encoding makes it significantly easier to build an interoperable file format.