Closed yukibtc closed 2 months ago
Also the title is misleading since this is not what "zero copy" means. "Zero copy" is just a stupid name for "zero heap allocations" and the original code didn't do any heap allocations in the first place. Further, in hashes
we use from_byte_array
for array-accepting constructors.
What I believe is non-controversial about this PR: we want some infallible method that accepts an array. I wanted to suggest you to make just that change first but then I remembered about from_byte_array
thing.
Neat! Concept ACK.
I would like to use to_byte_array
and from_byte_array
to be consistent with hashes
. (I have proposed the same thing for SecretKey
in #724.)
Also the title is misleading since this is not what "zero copy" means. "Zero copy" is just a stupid name for "zero heap allocations" and the original code didn't do any heap allocations in the first place
Ahh, thanks for the clarification
I've done the changes as suggested.
Hi! This PR add 1 constructor and 2 methods to
Signature
struct:Signature::from_byte_array
constructorSignature::to_byte_array
andSignature::as_byte_array
methodsSignature::serialize
method