Skip to content

Commit

Permalink
fix #600
Browse files Browse the repository at this point in the history
  • Loading branch information
danemadsen committed Aug 4, 2024
1 parent b30186f commit d25758b
Showing 1 changed file with 15 additions and 17 deletions.
32 changes: 15 additions & 17 deletions lib/classes/providers/character.dart
Original file line number Diff line number Diff line change
Expand Up @@ -309,23 +309,21 @@ class Character extends ChangeNotifier {
String get hash {
Uint8List bytes;

if(_profile != null) {
bytes = _profile!.readAsBytesSync();
} else {
List<String> hashList = [
_name,
_description,
_personality,
_scenario,
_system,
_useGreeting.toString(),
_greetings.join(),
_useExamples.toString(),
_examples.join(),
];

bytes = utf8.encode(hashList.join());
}
List<String> hashList = [
_name,
_description,
_personality,
_scenario,
_system,
_useGreeting.toString(),
_greetings.join(),
_useExamples.toString(),
_examples.join(),
];

bytes = utf8.encode(hashList.join());

bytes.addAll(_profile!.readAsBytesSync());

return sha256.convert(bytes).toString();
}
Expand Down

0 comments on commit d25758b

Please sign in to comment.