Skip to content

SML (.sml)

.sml file signature | application/octet-stream

Standard ML (SML) is a source code file format used for programs written in the Standard ML programming language, which is maintained by the language community through its published specification and implementations. It is primarily used for functional programming, compiler development, research, and educational coursework in language theory. SML files are plain text and generally safe, although code from untrusted sources should be reviewed before compilation or execution.

Safe

Magic Bytes

Offset 0
3A 29 0A

Sources: Wikipedia

Extension

.sml

MIME Type

application/octet-stream

Byte Offset

0

Risk Level

Safe

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);
}

How to validate .sml files in Go

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

See the full API documentation for all endpoints and parameters.

Frequently Asked Questions

What is a .sml file?

A .sml file is identified by the magic bytes 3A 29 0A at byte offset 0. Standard ML (SML) is a source code file format used for programs written in the Standard ML programming language, which is maintained by the language community through its published specification and implementations. It is primarily used for functional programming, compiler development, research, and educational coursework in language theory. SML files are plain text and generally safe, although code from untrusted sources should be reviewed before compilation or execution.

What are the magic bytes for .sml files?

The magic bytes for SML files are 3A 29 0A at byte offset 0. These bytes uniquely identify the file format regardless of the file extension.

How do I validate a .sml file?

To validate a .sml file, read the first bytes of the file and compare them against the known magic bytes (3A 29 0A) at offset 0. This is more reliable than checking the file extension alone, as extensions can be renamed.

What is the MIME type for .sml files?

There is no officially registered MIME type for .sml files. Systems typically use application/octet-stream as a generic fallback when handling this format.

Is it safe to open .sml files?

SML (.sml) files are generally safe to open. They are classified as low risk because they primarily contain data rather than executable code. However, always ensure files come from a trusted source.