Resource Interchange File Format -- Compact Disc DigitalAudio
application/octet-stream
Magic Bytes
Offset: 0
52 49 46 46 43 44 44 41
Compact Disc Digital Audio (CDA) is a virtual resource interchange file format created by Microsoft to represent audio tracks on physical compact discs. It functions as a shortcut or pointer used by Windows operating systems to catalog and access specific audio sectors during playback on local media players. As a legacy format dependent on physical hardware, these files contain no actual audio data and pose no security risk, though they become inoperable once the source disc is removed.
Validation Code
How to validate .cda files in Python
Python
def is_cda(file_path: str) -> bool:
"""Check if file is a valid CDA by magic bytes."""
signature = bytes([0x52, 0x49, 0x46, 0x46, 0x43, 0x44, 0x44, 0x41])
with open(file_path, "rb") as f:
return f.read(8) == signature
How to validate .cda files in Node.js
Node.js
function isCDA(buffer: Buffer): boolean {
const signature = Buffer.from([0x52, 0x49, 0x46, 0x46, 0x43, 0x44, 0x44, 0x41]);
return buffer.subarray(0, 8).equals(signature);
}
Go
func IsCDA(data []byte) bool {
signature := []byte{0x52, 0x49, 0x46, 0x46, 0x43, 0x44, 0x44, 0x41}
if len(data) < 8 {
return false
}
return bytes.Equal(data[:8], signature)
}
API Endpoint
GET
/api/v1/cda
curl https://filesignature.org/api/v1/cda