import '../native/phash_loader.dart';

/// rgb-phash-v1 via vendored C++ (`phash_from_bytes`).
class RgbPhash {
  RgbPhash({PhashNative? native}) : _native = native ?? PhashNative();

  final PhashNative _native;

  /// Hash encoded image bytes (JPEG from crop, PNG, etc.).
  String fromImageBytes(List<int> bytes) => _native.hashFromBytes(bytes);

  /// Alias used after CardCropper JPEG output.
  String fromJpegBytes(List<int> bytes) => fromImageBytes(bytes);
}
