mirror of
https://github.com/Yubico/yubioath-flutter.git
synced 2024-11-25 23:14:18 +03:00
use hash for cached filenames
This commit is contained in:
parent
494e99b36f
commit
836fee3fe9
@ -3,6 +3,7 @@ import 'dart:developer';
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:archive/archive.dart';
|
||||
import 'package:crypto/crypto.dart';
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:logging/logging.dart';
|
||||
@ -49,7 +50,8 @@ class FileSystemCache {
|
||||
cacheDirectory = Directory('${documentsDirectory.path}${Platform.pathSeparator}issuer_icons_cache${Platform.pathSeparator}');
|
||||
}
|
||||
|
||||
File _cachedFile(String fileName) => File('${cacheDirectory.path}${fileName}_cached');
|
||||
File _cachedFile(String fileName) => File(
|
||||
cacheDirectory.path + sha256.convert(utf8.encode(fileName)).toString());
|
||||
|
||||
Future<Uint8List?> getCachedFileData(String fileName) async {
|
||||
final file = _cachedFile(fileName);
|
||||
|
@ -170,7 +170,7 @@ packages:
|
||||
source: hosted
|
||||
version: "0.3.3+4"
|
||||
crypto:
|
||||
dependency: transitive
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: crypto
|
||||
sha256: aa274aa7774f8964e4f4f38cc994db7b6158dd36e9187aaceaddc994b35c6c67
|
||||
|
@ -59,6 +59,7 @@ dependencies:
|
||||
path: ^1.8.2
|
||||
file_picker: ^5.2.5
|
||||
archive: ^3.3.2
|
||||
crypto: ^3.0.2
|
||||
|
||||
dev_dependencies:
|
||||
integration_test:
|
||||
|
Loading…
Reference in New Issue
Block a user