Empty SQLite Database
Empty SQLite Database is a SQLite Database sample generated for file format testing. It can be used to test downloads, parsers, previews, and file type detection.
empty.sqliteDatabase
単一ファイルで完結するリレーショナルデータベース。先頭に16バイトの識別文字列があります。
53 51 4C 69 74 65 20 66 6F 72 6D 61 74 20 33 00 SQLite format 3.SIGNATURE = bytes.fromhex("53514c69746520666f726d6174203300")
OFFSET = 0
def is_sqlite(path: str) -> bool:
with open(path, "rb") as f:
f.seek(OFFSET)
head = f.read(len(SIGNATURE))
return head == SIGNATUREconst SIGNATURE = [0x53, 0x51, 0x4c, 0x69, 0x74, 0x65, 0x20, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x20, 0x33, 0x00];
const OFFSET = 0;
// bytes: a Uint8Array / Buffer holding the start of the file
export function isSqlite(bytes) {
return SIGNATURE.every((byte, i) => bytes[OFFSET + i] === byte);
}package fileid
import "bytes"
var issqliteSignature = []byte{0x53, 0x51, 0x4c, 0x69, 0x74, 0x65, 0x20, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x20, 0x33, 0x00}
const issqliteOffset = 0
func IsSqlite(b []byte) bool {
end := issqliteOffset + len(issqliteSignature)
if len(b) < end {
return false
}
return bytes.Equal(b[issqliteOffset:end], issqliteSignature)
}const SIGNATURE: &[u8] = &[0x53, 0x51, 0x4c, 0x69, 0x74, 0x65, 0x20, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x20, 0x33, 0x00];
const OFFSET: usize = 0;
fn is_sqlite(bytes: &[u8]) -> bool {
bytes.get(OFFSET..OFFSET + SIGNATURE.len()) == Some(SIGNATURE)
}<?php
$signature = "\x53\x51\x4c\x69\x74\x65\x20\x66\x6f\x72\x6d\x61\x74\x20\x33\x00";
$offset = 0;
function is_sqlite(string $bytes): bool {
global $signature, $offset;
return substr($bytes, $offset, strlen($signature)) === $signature;
}SQLite Database はデータ交換、インポート/エクスポート、パーサのテスト、検証ワークフローで使われます。エンコーディング・区切り文字・バージョン・コンテナ構造が実装の挙動を変えることがあります。
形式が判定できたからといって、信頼できない入力が安全とは限りません。パーサ例外・巨大ファイル・想定外のエンコーディング・外部参照を考慮してください。
11 個のサンプルで、先頭バイト判定・パーサのエラー・アップロード上限・ダウンロード挙動をテストできます。
Empty SQLite Database is a SQLite Database sample generated for file format testing. It can be used to test downloads, parsers, previews, and file type detection.
empty.sqliteBlue Sky SQLITE is a SQLite Database sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.
01-blue-sky.sqlitede49b67e2d35c5fd8ac1ce47d430c5f462d1f07316e092933d1955f13de7fd3fFlower Garden SQLITE is a SQLite Database sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.
02-flower-garden.sqlite8809e67a69e609d885d109df795d541c49a256abebeadccf6794c4151f5d3070Navy Blue Sky SQLITE is a SQLite Database sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.
03-navy-blue-sky.sqlite08ae8fc7f0d91d2dda5d6dfd1f759168d05caed61b2ce0620cf4a0b0249e2d0eNature of the Sky SQLITE is a SQLite Database sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.
04-nature-sky.sqlite778f053503b486a52c4bcf9a1a6cee74e233866961ac6ab03351ed9b6dcd6149Sky Landscape SQLITE is a SQLite Database sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.
05-sky-landscape.sqlite3deb27219fedc47feeb97b2617a7f348aad2cad5066bd3ee8fe7b10bfa8fc6beStarry Sky SQLITE is a SQLite Database sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.
06-starry-sky.sqlited9319a9126f7828c9d3e08acb49b87b289a34cff30c2e74cd61add5b65db72a9Blue Night Sky SQLITE is a SQLite Database sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.
07-blue-night-sky.sqlite6cdf3497c3ad14acd2a0b0d133ddfbbbd9ae59372112b5949be35c348114d760Hibiscus Flower SQLITE is a SQLite Database sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.
08-hibiscus-flower.sqlite51f07ec19ac5e239e3f82a601bd65a89e0b971c584b9f5e8b62088c84092a2fbArctic Sky SQLITE is a SQLite Database sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.
09-arctic-sky.sqlite040cdcac8bc3b0df0ac4e90155ce7d170a9f7abfa0e2528dce0cd631dbfb97cdNASA Blue Marble SQLITE is a SQLite Database 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.sqlitedb6f2b0c850281a93c68e813096391ff9d879894b07cff9f39487c8b5aced8f4SQLite Database ファイルはバイトシグネチャ 53 51 4C 69 74 65 20 66 6F 72 6D 61 74 20 33 00 ("SQLite format 3.") で始まります。拡張子に頼らず、この先頭バイトを読み取って形式を判定してください。
SQLite Database のMIMEタイプは application/vnd.sqlite3 です。
SQLite Database ファイルは .sqlite, .sqlite3, .db 拡張子を使います。拡張子は慣習にすぎず中身を保証しないため、シグネチャや構造のチェックと組み合わせてください。