Both java_buffer::from_array and GetByteArrayRegion support consuming a slice of the array by passing offset and length, the change adds a bufOffset arguments to fastDigest to avoid unnecessary array copy in singlePass which needs to invoke fastDigest method.
Issue #, if available: #407
Description of changes:
Both java_buffer::from_array and GetByteArrayRegion support consuming a slice of the array by passing offset and length, the change adds a
bufOffset
arguments tofastDigest
to avoid unnecessary array copy in singlePass which needs to invokefastDigest
method.We have tested the fix with JMH:
JMH result: W/o fix:
W/ fix:
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.