Skip to content

Commit c546f66

Browse files
committed
chore: add a phy score data
1 parent 0ce044e commit c546f66

File tree

6 files changed

+91
-125
lines changed

6 files changed

+91
-125
lines changed

assets/experiment_score/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
| 已上传 | __CF0429053BE1624B0AE557A2 | 536e85894cd73e97799457238821a0d4 |
1616
| 未上传 | __2B0A2898A8636392D36D4FD3 | 96df69201f754f554aded7076618b049 |
1717
| 0 | __3DA828A2FE2179673BC64990 | 1e132501c0b8f55fda1fa159119ecb79 |
18+
| 5 | __41E92D00A295779CE47B4B1B | 289accf624226e99e110de225f7ee298 |
1819
| 5.5 | __C4006511E511A3F2A90F5138 | 4339cc32f36c073cb486cd9554898783 |
1920
| 6 | __C94F2959A8B2781871FE4AE2 | a99492ec5e00e65229f730c2cfc3c815 |
2021
| 6.5 | __4B66616AEB2EA46E369250FF | dc50f78996082bf95c643dab7e41da7b |
@@ -38,7 +39,6 @@
3839
| 3.5 |
3940
| 4 |
4041
| 4.5 |
41-
| 5 |
4242

4343
### 文件夹结构
4444

assets/experiment_score/calculate_fnv1a.dart

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// ignore_for_file: avoid_print
2+
13
import 'dart:convert';
24
import 'dart:io';
35
import 'package:image/image.dart' as img;
@@ -35,8 +37,7 @@ void main(List<String> arguments) async {
3537

3638
// 计算哈希值
3739
final hash = await _calculatePixelFNV1A(entity);
38-
fileHashes[relativePath.substring(0, relativePath.length - 4)] =
39-
hash;
40+
fileHashes[relativePath.substring(0, relativePath.length - 4)] = hash;
4041
}
4142
}
4243

@@ -76,20 +77,16 @@ Future<int> _calculatePixelFNV1A(File file) async {
7677
final a = pixel.a.toInt();
7778
if (a == 255) {
7879
// ignore the transparent pixel to reduce the calculation
79-
pixelBytes.addAll([
80-
pixel.r.toInt(),
81-
pixel.g.toInt(),
82-
pixel.b.toInt(),
83-
]);
80+
pixelBytes.addAll([pixel.r.toInt(), pixel.g.toInt(), pixel.b.toInt()]);
8481
}
8582
}
8683
}
8784

88-
var _hash = 0x811C9DC5;
85+
var hash = 0x811C9DC5;
8986
for (var p in pixelBytes) {
90-
_hash ^= p;
91-
_hash = (_hash * 0x01000193) & 0xFFFFFFFF;
87+
hash ^= p;
88+
hash = (hash * 0x01000193) & 0xFFFFFFFF;
9289
}
9390

94-
return _hash;
91+
return hash;
9592
}
183 Bytes
Loading

lib/generated/score_hashes.g.dart

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)