# `HfHub.LFS.UploadInfo`
[🔗](https://github.com/North-Shore-AI/hf_hub_ex/blob/v0.3.1/lib/hf_hub/lfs.ex#L11)

Information required to determine upload method for a file.

Contains:
- `sha256` - SHA256 hash of the file content (binary)
- `size` - Total file size in bytes
- `sample` - First 512 bytes of the file (for content detection)

# `t`

```elixir
@type t() :: %HfHub.LFS.UploadInfo{
  sample: binary(),
  sha256: binary(),
  size: non_neg_integer()
}
```

# `from_binary`

```elixir
@spec from_binary(binary()) :: t()
```

Creates UploadInfo from binary data.

Calculates SHA256 hash on the binary directly.

# `from_path`

```elixir
@spec from_path(Path.t()) :: t()
```

Creates UploadInfo from a file path.

Reads the file to calculate SHA256 hash and captures the first 512 bytes.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
