HomePhabricator

refactor: make EncodeBase{32,64} consume Spans

Description

refactor: make EncodeBase{32,64} consume Spans

Summary:

To simplify the interface of the Base32/Base64 encoding functions for
raw data, this PR changes them from taking two arguments (pointer and
length) to just one Span. Most calls to EncodeBase64 pass data from
CDataStream instances, which unfortunately internally work with char*
pointers rather than unsigned char*, but thanks to the recently
introduced MakeUCharSpan helper, converting them is quite easy.

Backport of core PR19687.

Depends on D9183.

Test Plan:

ninja all check-all

Reviewers: #bitcoin_abc, PiRK

Reviewed By: #bitcoin_abc, PiRK

Differential Revision: https://reviews.bitcoinabc.org/D9184

Details

Provenance
Sebastian Falbesoner <sebastian.falbesoner@gmail.com>Authored on Aug 7 2020, 17:55
FabienCommitted on Feb 9 2021, 12:44
FabienPushed on Feb 9 2021, 12:46
Reviewer
Restricted Project
Differential Revision
D9184: refactor: make EncodeBase{32,64} consume Spans
Parents
rABC3288ce1b2218: refactor: Make HexStr take a span
Branches
Unknown
Tags
Unknown