generateLegacyFingerprint static method

String generateLegacyFingerprint(
  1. String salt,
  2. String password
)

Generate a unique fingerprint for legacy wallets from salt and password

Implementation

static String generateLegacyFingerprint(String salt, String password) {
  // Combine salt and password with a separator that won't appear in either
  final combined = '$salt|LEGACY|$password';

  // Convert to bytes and hash with SHA-256
  final bytes = Uint8List.fromList(utf8.encode(combined));
  final hashBytes = CryptoUtils.hashData(bytes);

  // Convert to hex string for storage
  final hexString =
      hashBytes.map((byte) => byte.toRadixString(16).padLeft(2, '0')).join();

  return hexString;
}