-4

Do both base64 (from coreutils) and uuencode -m and uudecode (from sharutils) implement base64 encoding and decoding? Can they be used exchangeably?

Tim
  • 101,790
  • 2
    Try man uuencode, which will demonstrate that they're not synonymous. – Thomas Dickey Nov 21 '18 at 00:47
  • I can't figure out if they are exchangeable as far as base64 encoding/decoding is concerned. – Tim Nov 21 '18 at 00:52
  • There are (at least) two different mappings for base64. You'd have to read the source-code to be certain that they're the same. – Thomas Dickey Nov 21 '18 at 01:12
  • "different mappings for base64", for example? – Tim Nov 21 '18 at 01:27
  • 2
    RFC 3548 and RFC 4648. – Thomas Dickey Nov 21 '18 at 01:35
  • @ThomasDickey Being, as it is, that 4648 obsoletes 3548, there is only one valid base64 encoding. And being, as it is, that both use (in practice) the same wording for section 4 base64 any difference should have been reported as a bug long time ago. –  Nov 21 '18 at 21:27
  • @ThomasDickey Could you provide a file example that doesn't encode the same in uuencode -m and bas64 (beside the added header and footer of uuencode)?. –  Nov 21 '18 at 23:05

1 Answers1

1

Except for the header and tail that uuencode adds to its output, yes:

$ uuencode -m - <<<"Hello World! test"
begin-base64 644 -
SGVsbG8gV29ybGQhIHRlc3QK
====

$ base64 <<<"Hello World! test"
SGVsbG8gV29ybGQhIHRlc3QK

But uuencode is specified by posix, base64 no.