Re:Ox is a fast text editor, written in Rust, that runs in y...
by zoltar on Tuesday November 03, 2020 @03:27AM
(#24977615)
Incorrect. The base64 command wraps at 76 columns by default.
[ Parent
| on HN ]
Re:Ox is a fast text editor, written in Rust, that runs in y...
by oefrha on Tuesday November 03, 2020 @03:50AM
(#24977736)
Whether there's a wrapping feature depends on the implementation. coreutils base64, yes. Other implementations, maybe not. macOS's /usr/bin/base64 for instance doesn't have the concept of wrapping. FreeBSD base64, judging from the manpage, doesn't do that either. https://www.freebsd.org/cgi/man.cgi?query=base64
Edit: Oops, posted some misinformation. The mistaken part, reproduced below:
> First, wrapping by default only occurs when writing to a tty. When stdout is redirected to a file, wrapping base64 output usually doesn't make sense, so wrapping doesn't happen.
Correction: coreutils base64 wraps regardless of whether stdout is a tty.
Re:Ox is a fast text editor, written in Rust, that runs in y...
by tzs on Tuesday November 03, 2020 @06:09AM
(#24978510)
> macOS's /usr/bin/base64 for instance doesn't have the concept of wrapping
Yes it does. "-b N" or "--break=N" inserts a line break every N characters.
Re:Ox is a fast text editor, written in Rust, that runs in y...
by oefrha on Tuesday November 03, 2020 @06:26AM
(#24978612)
Yeah. I know -w doesn't work, and missed -b when glancing at the manpage. (I use coreutils day to day.)
Re:Ox is a fast text editor, written in Rust, that runs in y...
by OskarS on Tuesday November 03, 2020 @04:25AM
(#24977941)
I ran it on macOS, and there I got:
$ base64 /dev/urandom | head -c 1000000000 | wc
0 1 1000000000
I haven't tried anywhere else, so it might be different on Linux or GNU or whatever.