Previously, I switched from using ByteBuffer to byte[] in the interest of avoiding an allocation on every call to generateOneTimePassword. It turns out those were two orthogonal ideas, though, and we can keep the ByteBuffer and still avoid repeated allocations.
Switching back to a ByteBuffer makes things a lot more readable and ~actually gives us a very modest throughput boost, too~ has no statistically-significant effect on throughput.
Previously, I switched from using
ByteBuffer
tobyte[]
in the interest of avoiding an allocation on every call togenerateOneTimePassword
. It turns out those were two orthogonal ideas, though, and we can keep theByteBuffer
and still avoid repeated allocations.Switching back to a
ByteBuffer
makes things a lot more readable and ~actually gives us a very modest throughput boost, too~ has no statistically-significant effect on throughput.