Trait neptune::BatchHasher
source · pub trait BatchHasher<F, A>where
F: PrimeField,
A: Arity<F>,{
// Required method
fn hash(
&mut self,
preimages: &[GenericArray<F, A>],
) -> Result<Vec<F>, Error>;
// Provided methods
fn hash_into_slice(
&mut self,
target_slice: &mut [F],
preimages: &[GenericArray<F, A>],
) -> Result<(), Error> { ... }
fn max_batch_size(&self) -> usize { ... }
}
Required Methods§
Provided Methods§
fn hash_into_slice( &mut self, target_slice: &mut [F], preimages: &[GenericArray<F, A>], ) -> Result<(), Error>
sourcefn max_batch_size(&self) -> usize
fn max_batch_size(&self) -> usize
max_batch_size
is advisory. Implenters of BatchHasher
should ensure that up to the returned max hashes can
be safely performed on the target GPU (currently 2080Ti). The max returned should represent a safe batch size
optimized for performance.
BatchHasher
users are responsible for not attempting to hash batches larger than the advised maximum.