mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-10-19 05:58:50 +02:00
17 lines
489 B
Dart
17 lines
489 B
Dart
import 'dart:convert';
|
|
|
|
import 'package:cake_wallet/.secrets.g.dart' as secrets;
|
|
import 'package:cw_core/wallet_base.dart';
|
|
import 'package:hashlib/hashlib.dart';
|
|
|
|
String createHashedWalletIdentifier(WalletBase wallet) {
|
|
final hashContent = wallet.seed ?? wallet.walletAddresses.primaryAddress;
|
|
|
|
final salt = secrets.walletGroupSalt;
|
|
final combined = '$salt.$hashContent';
|
|
|
|
final bytes = utf8.encode(combined);
|
|
final digest = sha256.convert(bytes);
|
|
return digest.toString();
|
|
}
|