From ea7c1a7ab0d6fad60a5e2c0f994a0dbb71cfaa84 Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Sat, 24 Sep 2022 02:43:59 -0500 Subject: [PATCH] Speed up base64. --- toys/other/base64.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/toys/other/base64.c b/toys/other/base64.c index 22652fd0..1281e372 100644 --- a/toys/other/base64.c +++ b/toys/other/base64.c @@ -5,8 +5,8 @@ * See https://tools.ietf.org/html/rfc4648 // These optflags have to match. Todo: cleanup and collapse together? -USE_BASE64(NEWTOY(base64, "diw#<0=76[!dw]", TOYFLAG_USR|TOYFLAG_BIN)) -USE_BASE32(NEWTOY(base32, "diw#<0=76[!dw]", TOYFLAG_USR|TOYFLAG_BIN)) +USE_BASE64(NEWTOY(base64, "diw#<0=76[!dw]", TOYFLAG_USR|TOYFLAG_BIN|TOYFLAG_LINEBUF)) +USE_BASE32(NEWTOY(base32, "diw#<0=76[!dw]", TOYFLAG_USR|TOYFLAG_BIN|TOYFLAG_LINEBUF)) config BASE64 bool "base64" @@ -39,6 +39,7 @@ config BASE32 GLOBALS( long w; + unsigned total; unsigned n; // number of bits used in encoding. 5 for base32, 6 for base64 unsigned align; // number of bits to align to -- 2.39.2