Blue Sky JS
Blue Sky JS is a JavaScript sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.
01-blue-sky.js7d3b2994ee0a1c9c28837d0ba8de3ec918b7820baa1291e49ef20c85c9a343ffCode
WebやNode.jsで広く使われるプログラミング言語のソースファイル。固定のバイナリシグネチャはありません。
65 78 70 6F 72 74 exportSIGNATURE = bytes.fromhex("6578706f7274")
OFFSET = 0
def is_js(path: str) -> bool:
with open(path, "rb") as f:
f.seek(OFFSET)
head = f.read(len(SIGNATURE))
return head == SIGNATUREconst SIGNATURE = [0x65, 0x78, 0x70, 0x6f, 0x72, 0x74];
const OFFSET = 0;
// bytes: a Uint8Array / Buffer holding the start of the file
export function isJs(bytes) {
return SIGNATURE.every((byte, i) => bytes[OFFSET + i] === byte);
}package fileid
import "bytes"
var isjsSignature = []byte{0x65, 0x78, 0x70, 0x6f, 0x72, 0x74}
const isjsOffset = 0
func IsJs(b []byte) bool {
end := isjsOffset + len(isjsSignature)
if len(b) < end {
return false
}
return bytes.Equal(b[isjsOffset:end], isjsSignature)
}const SIGNATURE: &[u8] = &[0x65, 0x78, 0x70, 0x6f, 0x72, 0x74];
const OFFSET: usize = 0;
fn is_js(bytes: &[u8]) -> bool {
bytes.get(OFFSET..OFFSET + SIGNATURE.len()) == Some(SIGNATURE)
}<?php
$signature = "\x65\x78\x70\x6f\x72\x74";
$offset = 0;
function is_js(string $bytes): bool {
global $signature, $offset;
return substr($bytes, $offset, strlen($signature)) === $signature;
}JavaScript はデータ交換、インポート/エクスポート、パーサのテスト、検証ワークフローで使われます。エンコーディング・区切り文字・バージョン・コンテナ構造が実装の挙動を変えることがあります。
形式が判定できたからといって、信頼できない入力が安全とは限りません。パーサ例外・巨大ファイル・想定外のエンコーディング・外部参照を考慮してください。
11 個のサンプルで、先頭バイト判定・パーサのエラー・アップロード上限・ダウンロード挙動をテストできます。
Blue Sky JS is a JavaScript sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.
01-blue-sky.js7d3b2994ee0a1c9c28837d0ba8de3ec918b7820baa1291e49ef20c85c9a343ffFlower Garden JS is a JavaScript sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.
02-flower-garden.jse4e0e31904121880833d098f0ece7e5f03c7a87c9e8bfc347620f2b0edd23755Navy Blue Sky JS is a JavaScript sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.
03-navy-blue-sky.js68a18b0a81d6a381122fdca7a48615cccef3e9321b56eb3d848906446faef1a8Nature of the Sky JS is a JavaScript sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.
04-nature-sky.js88f8a8495116ba8f94009b85973fe8d1682fbd9df9858f078a8a16bb8cf419c6Sky Landscape JS is a JavaScript sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.
05-sky-landscape.js12c8c7523d5e78f0eef8f10c99b51f90230c44c290ae8f54d560f64222c70772Starry Sky JS is a JavaScript sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.
06-starry-sky.jsd0a79f3af31aac614a4aa57699d5916597a604ad7f46e9e46d6d70f52ba5cc78Blue Night Sky JS is a JavaScript sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.
07-blue-night-sky.jsd172ade12c1b20dc0894883054a56a48036c23d954ae2d33c29e75323ed99492Hibiscus Flower JS is a JavaScript sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.
08-hibiscus-flower.jsadd6427d73d92168b6c82a494d5767ab535830a8800de179191eca218c1dcd47Arctic Sky JS is a JavaScript sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.
09-arctic-sky.jsfaec434d8db0ad7ebc4aa173410aa473e07ff40afb5e9f79f1e7ed9e40b75c0aSunset Rays JS is a JavaScript sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.
10-sunset-rays.jsff8d74f4347a005c4c07e4e0c1914439b5b893d81328fd483c378ad2efd7324aNASA Blue Marble JS is a JavaScript 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.js83674dbcffe0c1c778f58bac76805f2f5b1f6399e064a9ec50feba9c7624cdf2JavaScript ファイルはバイトシグネチャ 65 78 70 6F 72 74 ("export") で始まります。拡張子に頼らず、この先頭バイトを読み取って形式を判定してください。
JavaScript のMIMEタイプは text/javascript, application/javascript です。
JavaScript ファイルは .js, .mjs, .cjs 拡張子を使います。拡張子は慣習にすぎず中身を保証しないため、シグネチャや構造のチェックと組み合わせてください。