PbjBytesHasher when hashing protobuf objects it is inefficient as it has to go form PBJ protobuf object to byte[] then to MessageDigest.
Solution
PBJ serialization is stream based and so is MessageDigest. We just need to connect them together. I have filled a PBJ enhancement to add convenience method to make this easy. Once that is implemented then PbjBytesHasher can be updated to use it.
See https://github.com/hashgraph/pbj/issues/271
Also as a side note PbjBytesHasher is not the most obvious name as it is very generic, PbjEventHasher would be better 😀
PbjBytesHasher is not currently being used, because it was replaced in develop by PbjStreamHasher that does not create a byte[] as an intermediary. So I think we can close this ticket
Problem
PbjBytesHasher
when hashing protobuf objects it is inefficient as it has to go form PBJ protobuf object tobyte[]
then toMessageDigest
.Solution
PBJ serialization is stream based and so is
MessageDigest
. We just need to connect them together. I have filled a PBJ enhancement to add convenience method to make this easy. Once that is implemented thenPbjBytesHasher
can be updated to use it. See https://github.com/hashgraph/pbj/issues/271 Also as a side notePbjBytesHasher
is not the most obvious name as it is very generic,PbjEventHasher
would be better 😀Alternatives
No response