【发布时间】:2019-09-29 10:49:39
【问题描述】:
我正在尝试编写一个在后台运行 scrypt 函数的函数,因为它非常慢。我以前曾经计算过,但由于某种原因,这次我得到“未定义函数计算”
import "package:pointycastle/pointycastle.dart" as PC;
import 'dart:async';
Future<Uint8List> getKey(Uint8List password,Uint8List salt) async {
return await compute(computeKey, [password,salt]);
}
Uint8List computeKey(List<Uint8List> param) {
Uint8List salt=param[1];
Uint8List password=param[1];
PC.KeyDerivator scrypt = new PC.KeyDerivator("scrypt");
scrypt.init(new PC.ScryptParameters(16384, 8, 1, 49, salt));
return scrypt.process(password);
}
【问题讨论】:
标签: asynchronous flutter dart