private static function hashNormalize($hash, $size, $algo)
{
// Extend hash if too short
while (Str::strlen($hash) < $size) {
$hash .= \hash($algo, $hash, true);
}
// Truncate to specified number of bytes (if needed) and return
return Str::substr($hash, 0, $size);
}