SML
application/octet-stream
Magic Bytes
Offset: 0
3A 29 0A
Standard ML (SML) is a file format used by the modular functional programming language originally developed by Robin Milner and maintained by the Standard ML of New Jersey project. This format is primarily utilized for compiler implementation, logical theorem proving, and formal software verification within academic and industrial research settings. While the format is considered safe for storage, compiled heap images should be executed within controlled environments to mitigate security risks from untrusted sources.
Validation Code
How to validate .sml files in Python
Python
def is_sml(file_path: str) -> bool:
"""Check if file is a valid SML by magic bytes."""
signature = bytes([0x3A, 0x29, 0x0A])
with open(file_path, "rb") as f:
return f.read(3) == signature
How to validate .sml files in Node.js
Node.js
function isSML(buffer: Buffer): boolean {
const signature = Buffer.from([0x3A, 0x29, 0x0A]);
return buffer.subarray(0, 3).equals(signature);
}
Go
func IsSML(data []byte) bool {
signature := []byte{0x3A, 0x29, 0x0A}
if len(data) < 3 {
return false
}
return bytes.Equal(data[:3], signature)
}
API Endpoint
GET
/api/v1/sml
curl https://filesignature.org/api/v1/sml