HfHub.LFS.UploadInfo (HfHub v0.2.0)

Copy Markdown View Source

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)

Summary

Functions

Creates UploadInfo from binary data.

Creates UploadInfo from a file path.

Types

t()

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

Functions

from_binary(data)

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

Creates UploadInfo from binary data.

Calculates SHA256 hash on the binary directly.

from_path(path)

@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.