Merge pull request #6826 from urbit/pkova/base64-fix

zuse: fix +de:base64:mimes:html
This commit is contained in:
Pyry Kovanen 2023-10-16 17:36:34 +03:00 committed by GitHub
commit 2a2f9645b6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -4298,8 +4298,11 @@
~&(%base-64-padding-err-two ~)
=/ len (sub (mul 3 (div (add lat dif) 4)) dif)
:+ ~ len
%+ swp 3
(rep [0 6] (flop (weld dat (reap dif 0))))
=/ res (rsh [1 dif] (rep [0 6] (flop dat)))
=/ amt (met 3 res)
:: left shift trailing zeroes in after byte swap
=/ trl ?: (lth len amt) 0 (sub len amt)
(lsh [3 trl] (swp 3 res))
--
--
::