Magic バイト識別:よくある間違いと対処法
実際に起こる失敗パターンと、それが出力にどう現れるか、そして具体的な対処法。
使い方
- まず入力のエンコーディングを確認します——余分な BOM や UTF-8 以外の貼り付けは、ツールが動く前に結果を壊します。
- サイレントな切り詰めを探します。出力長が不自然に切りの良い数字なら、何かが失われています。
- 変更したオプションがタスクに必要なものか確認します。既定値の消し忘れが「もっともらしいが誤った結果」の最大原因です。
- 手計算で検証できる最小入力で再実行し、その後で実データを戻します。
例
The PNG signature followed by the start of its IHDR chunk.
入力
89504E470D0A1A0A0000000D49484452
出力 — 検索結果
Bytes: 89 50 4E 47 0D 0A 1A 0A ASCII: .PNG.... Detected: PNG image Signature matched: 89504E470D0A1A0A → PNG image Detection is by file signature, not by extension — this is how servers should validate uploads, since a client can rename anything to .png.
実行
説明
Identify a file type from its signature bytes rather than its extension — the safe way to validate uploads.
関連ツール
ファイル to Base64 変換Encode any local file to Base64 — nothing is uploaded.Base64to ファイル DownloaderDecode Base64 back into the original file.ファイルハッシュチェックMD5/SHA-1/SHA-256/SHA-512 of any file, computed locally.ファイル MetadataViewerInspect name, MIME type, size and modification time.ファイル to ZIP パッケージャBundle multiple files into a ZIP archive locally.Base64 エンコードEncode text, JSON, URLs or files to Base64, standard or URL-safe.