pbkdf2 method
Pbkdf2
pbkdf2({})
A factory used by Pbkdf2
.
Implementation
@override
Pbkdf2 pbkdf2({
required MacAlgorithm macAlgorithm,
required int iterations,
required int bits,
}) {
// Platform implementation?
final platformImpl = FlutterPbkdf2(
macAlgorithm: macAlgorithm,
iterations: iterations,
bits: bits,
fallback: DartPbkdf2(
macAlgorithm: macAlgorithm,
iterations: iterations,
bits: bits,
),
);
if (platformImpl.isSupported) {
return platformImpl;
}
// Background implementation?
final backgroundImpl = BackgroundPbkdf2(
macAlgorithm: macAlgorithm,
bits: bits,
iterations: iterations,
);
if (backgroundImpl.isSupported) {
return backgroundImpl;
}
// Default
return super.pbkdf2(
macAlgorithm: macAlgorithm,
iterations: iterations,
bits: bits,
);
}