Ross ROSS = Recommend OSS · open-source software intelligence for agents

h2non/filetype

Fast, dependency-free Go package to infer binary file types based on the magic numbers header signature observed · 2026-08-28

github.com/h2non/filetype · homepage · Go · MIT (permissive) observed · 2026-08-28

Health v2 · maintenance only

63/100

  • Activity 90
  • Release rhythm 8
  • Longevity 100
How is this computed?

round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10) — computed 2026-09-03. Adoption (stars, forks) is never an input.

  • gap_med: n/a
  • age_days: 3996
  • days_rel: n/a
  • days_push: 63
  • n_releases_24m: 0

Full methodology

Adoption not part of the score

2297 stars · 190 forks observed · 2026-08-28

What it is AI-extracted, prompt v1, taxonomy v1, 2026-08-30, confidence not recorded

A small, dependency-free Go library that infers file and MIME types by checking binary magic number signatures. It supports a wide range of file types, requires only the first 262 bytes of a file, and allows pluggable custom matchers.

Use cases

  • detect the real file type of an uploaded file regardless of its extension
  • get the MIME type from a binary file header in Go
  • check if a file is an image, video, or audio by its content
  • validate that uploaded files match their claimed extension
  • identify file types from just the first bytes of a stream

When to choose

  • you need fast, dependency-free file type detection in Go
  • you only have access to a file header or byte slice, not the full file
  • you want to validate uploads by content rather than trusting extensions or client-supplied MIME types

When to avoid

  • you need to detect text-based formats like SVG (use go-is-svg instead)
  • you need deep content inspection beyond the file header
  • you are not working in Go

Facets

library · maturity stable

parser developer-tools files developer-tools go cross-platform magic-numbers mime-type file-type-detection file-validation

4 sources

Member repositories

RepositoryRoleHealth v2
h2non/filetypemain63

For agents

markdown · JSON · MCP: product_card(name="h2non/filetype")

Data as of 2026-08-30T08:39:29.467469+00:00 · Report a problem