Open VaslD opened 1 year ago
Yup, it sure does! Would you like to submit a patch to fix it? As a practical matter I think we can ignore the regions here, and just use the sequence conformance directly.
PR done. Don't know how to construct a multi-region Data
to test it yet, but it shouldn't get worse. :-)
I was looking for a not
%02x
way of converting binary to hexString
, and I stumbled upon the implementation inPrettyBytes.swift
.https://github.com/apple/swift-crypto/blob/9cc89f0170308b813af05dadcd26f9a2dee47713/Sources/Crypto/Util/PrettyBytes.swift#L45-L51
I'm not 100% sure about the
Sequence
conformance of non-contiguousDataProtocol
, but it seemed to me that theself
on line 46 should be the ignored parameter$0
(or maybe eliminate the region logic since looping overself
most likely would have taken non-contiguous memory regions into account?), otherwise the code reads:Unless non-contiguous
DataProtocol
has non-stable indices and iterators, this code will over/re-iterate the data buffer.