Solian/lib/utils/file.dart

9 lines
222 B
Dart
Raw Normal View History

2024-05-03 08:16:42 +00:00
import 'dart:io';
import 'package:crypto/crypto.dart';
Future<String> calculateFileSha256(File file) async {
final bytes = await file.readAsBytes();
final digest = sha256.convert(bytes);
return digest.toString();
}