File size: 387 Bytes
892fa81
aac350d
 
 
 
 
892fa81
 
aac350d
 
892fa81
aac350d
 
 
892fa81
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
"""Hashing — delegates to cores.vision.hashing (single source of truth)."""

from __future__ import annotations

import numpy as np

from cores.vision import sha256_image


class ImageHasher:
    """SHA-256 over normalized JPEG bytes — stable cache key."""

    @staticmethod
    def hash(img: np.ndarray, quality: int = 90) -> str:
        return sha256_image(img, quality=quality)