flutter - For 循环神秘地没有运行,而其他循环却在运行
问题描述
我正在尝试运行隔离来运行我的离线散列身份验证功能。我将所有数据压缩到一个列表中,然后在函数中分配它。
出于某种奇怪的原因,第二个循环运行,而其他 2 个不运行。前两个是为了解决第三个不运行而创建的,现在第一个也不运行。我在这里想念什么?我从未见过没有抛出错误的循环不运行。
Future<bool> offlineAuthenticationThread(List<Tuple2<String, String>> storedCredentials) async {
print('Isolate running');
final DBCrypt hashing = DBCrypt();
bool authorized = false;
String userName = storedCredentials[0].item1;
String password = storedCredentials[0].item2;
List<String> usernameHashes = [];
List<String> passwordHashes = [];
storedCredentials.removeAt(0);
for (var index = 0; index >= storedCredentials.length; index++) {
print('1');
usernameHashes.add(storedCredentials[index].item1);
passwordHashes.add(storedCredentials[index].item2);
}
for (var index = 0; index >= usernameHashes.length; index++) {
print('2');
(hashing.checkpw(userName, usernameHashes[index]) && hashing.checkpw(password, passwordHashes[index]))
? authorized = true
: authorized = false;
}
for (var index = 1; index >= storedCredentials.length; index++) {
print('3');
(hashing.checkpw(userName, storedCredentials[index].item1) &&
hashing.checkpw(password, storedCredentials[index].item2))
? authorized = true
: authorized = false;
}
return authorized;
}
解决方案
推荐阅读
- html - HTML default namespace vs. explicit namespace
- javascript - Javascript 扩展运算符可以包含对象的未定义字段吗?
- uwp - UWP 多视图:关闭主视图时关闭所有辅助视图
- jquery - 取消单身日期
- codenameone - 在代号中从一个点到另一个点画直线
- json - 使用动态密钥解组 json
- python - 为什么当声明为变量名称时,我不能使用 OpenCV 将图像复制并粘贴到某个位置?
- xml - Xquery 不要“过滤”第一个带有属性的 TAG
- python - 在 Pandas (python) 中,如何添加由两列引用的 groupby 列
- outlook-addin - 确定已在 Outlook 加载项图标单击上选择了哪个操作