Nature Colors CSV
Nature Colors CSV is a Comma-Separated Values sample generated for file format testing. It can be used to test downloads, parsers, previews, and file type detection.
colors.csvData
表形式データをカンマ区切りで表すテキスト形式。ヘッダ行を持つことが多いです。
6E 61 6D 65 nameSIGNATURE = bytes.fromhex("6e616d65")
OFFSET = 0
def is_csv(path: str) -> bool:
with open(path, "rb") as f:
f.seek(OFFSET)
head = f.read(len(SIGNATURE))
return head == SIGNATUREconst SIGNATURE = [0x6e, 0x61, 0x6d, 0x65];
const OFFSET = 0;
// bytes: a Uint8Array / Buffer holding the start of the file
export function isCsv(bytes) {
return SIGNATURE.every((byte, i) => bytes[OFFSET + i] === byte);
}package fileid
import "bytes"
var iscsvSignature = []byte{0x6e, 0x61, 0x6d, 0x65}
const iscsvOffset = 0
func IsCsv(b []byte) bool {
end := iscsvOffset + len(iscsvSignature)
if len(b) < end {
return false
}
return bytes.Equal(b[iscsvOffset:end], iscsvSignature)
}const SIGNATURE: &[u8] = &[0x6e, 0x61, 0x6d, 0x65];
const OFFSET: usize = 0;
fn is_csv(bytes: &[u8]) -> bool {
bytes.get(OFFSET..OFFSET + SIGNATURE.len()) == Some(SIGNATURE)
}<?php
$signature = "\x6e\x61\x6d\x65";
$offset = 0;
function is_csv(string $bytes): bool {
global $signature, $offset;
return substr($bytes, $offset, strlen($signature)) === $signature;
}Comma-Separated Values はデータ交換、インポート/エクスポート、パーサのテスト、検証ワークフローで使われます。エンコーディング・区切り文字・バージョン・コンテナ構造が実装の挙動を変えることがあります。
形式が判定できたからといって、信頼できない入力が安全とは限りません。パーサ例外・巨大ファイル・想定外のエンコーディング・外部参照を考慮してください。
11 個のサンプルで、先頭バイト判定・パーサのエラー・アップロード上限・ダウンロード挙動をテストできます。
Nature Colors CSV is a Comma-Separated Values sample generated for file format testing. It can be used to test downloads, parsers, previews, and file type detection.
colors.csvBlue Sky CSV is a Comma-Separated Values sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.
01-blue-sky.csvb8c6c6d1304a6df369a2b23d14b71290e241a44c112e45cf0b0318c8534bd0baFlower Garden CSV is a Comma-Separated Values sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.
02-flower-garden.csv82f01fead0843a36da2ed3529a31ef75daa64cef329b52fed148fb560102d7f3Navy Blue Sky CSV is a Comma-Separated Values sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.
03-navy-blue-sky.csv77e2d7b1e7b2cf616ba094d5993cb6249cf2a66427c86daa6db305d64422e4bcNature of the Sky CSV is a Comma-Separated Values sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.
04-nature-sky.csv8fe507787be70647e108aa5264392d433c495732c1e6ff37602e3514551fd1e1Sky Landscape CSV is a Comma-Separated Values sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.
05-sky-landscape.csv3bf660b0d93762473747cbdf41c7721f9700abaa589461d0bcd4323a048fcdecStarry Sky CSV is a Comma-Separated Values sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.
06-starry-sky.csvae74b42ec074812ec903967974fe7e411cbb2f18154f477727f570a0c41393f2Blue Night Sky CSV is a Comma-Separated Values sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.
07-blue-night-sky.csv281a26f3126fbcaa8b310622107ae46290689eb1065431cc301d7265a34d7523Hibiscus Flower CSV is a Comma-Separated Values sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.
08-hibiscus-flower.csv895cd4d9e139546d63cb8e7607c65afd0d5f0cf240b3c237747fa32a5da5c472Arctic Sky CSV is a Comma-Separated Values sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.
09-arctic-sky.csv7de222dee3046df0502bfa7e9cbf40458ca1753eba204ca7be66a7f0044f2969NASA Blue Marble CSV is a Comma-Separated Values sample based on NASA Image and Video Library. It can be used to test downloads, parsers, previews, and file type detection.
nasa-blue-marble-2012-east.csvad9051e1e7e8aa2231b706e740a421d39b158c8900c604a0fd293d52e103af92Comma-Separated Values ファイルはバイトシグネチャ 6E 61 6D 65 ("name") で始まります。拡張子に頼らず、この先頭バイトを読み取って形式を判定してください。
Comma-Separated Values のMIMEタイプは text/csv です。
Comma-Separated Values ファイルは .csv 拡張子を使います。拡張子は慣習にすぎず中身を保証しないため、シグネチャや構造のチェックと組み合わせてください。