Blue Sky INI
Blue Sky INI is a INI Configuration sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.
01-blue-sky.ini5390986ec25e1dcc50005c53502b63a293c5b4bee6481ccda0aec4b9b27aa38fData
設定ファイルで広く使われるセクションとキー値のテキスト形式。Windowsや多くのツールで使われます。
5B 73 61 6D 70 6C 65 5D [sample]SIGNATURE = bytes.fromhex("5b73616d706c655d")
OFFSET = 0
def is_ini(path: str) -> bool:
with open(path, "rb") as f:
f.seek(OFFSET)
head = f.read(len(SIGNATURE))
return head == SIGNATUREconst SIGNATURE = [0x5b, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x5d];
const OFFSET = 0;
// bytes: a Uint8Array / Buffer holding the start of the file
export function isIni(bytes) {
return SIGNATURE.every((byte, i) => bytes[OFFSET + i] === byte);
}package fileid
import "bytes"
var isiniSignature = []byte{0x5b, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x5d}
const isiniOffset = 0
func IsIni(b []byte) bool {
end := isiniOffset + len(isiniSignature)
if len(b) < end {
return false
}
return bytes.Equal(b[isiniOffset:end], isiniSignature)
}const SIGNATURE: &[u8] = &[0x5b, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x5d];
const OFFSET: usize = 0;
fn is_ini(bytes: &[u8]) -> bool {
bytes.get(OFFSET..OFFSET + SIGNATURE.len()) == Some(SIGNATURE)
}<?php
$signature = "\x5b\x73\x61\x6d\x70\x6c\x65\x5d";
$offset = 0;
function is_ini(string $bytes): bool {
global $signature, $offset;
return substr($bytes, $offset, strlen($signature)) === $signature;
}INI Configuration はデータ交換、インポート/エクスポート、パーサのテスト、検証ワークフローで使われます。エンコーディング・区切り文字・バージョン・コンテナ構造が実装の挙動を変えることがあります。
形式が判定できたからといって、信頼できない入力が安全とは限りません。パーサ例外・巨大ファイル・想定外のエンコーディング・外部参照を考慮してください。
11 個のサンプルで、先頭バイト判定・パーサのエラー・アップロード上限・ダウンロード挙動をテストできます。
Blue Sky INI is a INI Configuration sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.
01-blue-sky.ini5390986ec25e1dcc50005c53502b63a293c5b4bee6481ccda0aec4b9b27aa38fFlower Garden INI is a INI Configuration sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.
02-flower-garden.ini0d455776327b7f8c380abc20446c6aeb3174645ea4e0e9f1057ca7eb452f9c46Navy Blue Sky INI is a INI Configuration sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.
03-navy-blue-sky.ini753d1c06b41a2fc055122dd24d90a571b3ce03f54cb4370ff1fa9454e51d6492Nature of the Sky INI is a INI Configuration sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.
04-nature-sky.iniadcd4cc0325b644736310105256c77af44db4919fa9cea2c31e758c2620df943Sky Landscape INI is a INI Configuration sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.
05-sky-landscape.ini293916ec89df7044fc3316b739c64399c67118841b93531ce884335b009b8448Starry Sky INI is a INI Configuration sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.
06-starry-sky.inied8cf89e846fbbc88bc02f3b5097547826718feda363fffcd672f40f1f479f01Blue Night Sky INI is a INI Configuration sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.
07-blue-night-sky.ini8fca89858072b208f983603607f87302eadb5a167c115f78de17609bd3cb7f23Hibiscus Flower INI is a INI Configuration sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.
08-hibiscus-flower.inie5b555c7d83a19837d888e086c27e8acbffc7fbde1a3f5faabf8ac9e68749b1fArctic Sky INI is a INI Configuration sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.
09-arctic-sky.ini4351d21df768292f6dc8f010686d84120bfe015a7f9c436f7b14bb82e5f634c2Sunset Rays INI is a INI Configuration sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.
10-sunset-rays.ini36685bc27e8418c2dffe2e6ea5a9ece1c21efeb009ced7c28dbed22dd4bd590dNASA Blue Marble INI is a INI Configuration 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.ini74de688d81b9ef2c50a3659225d5b16cdc1bdd0a954b5181a7e119bf9b58b957INI Configuration ファイルはバイトシグネチャ 5B 73 61 6D 70 6C 65 5D ("[sample]") で始まります。拡張子に頼らず、この先頭バイトを読み取って形式を判定してください。
INI Configuration のMIMEタイプは text/plain です。
INI Configuration ファイルは .ini, .conf, .cfg 拡張子を使います。拡張子は慣習にすぎず中身を保証しないため、シグネチャや構造のチェックと組み合わせてください。