File: application.py

package info (click to toggle)
filetype.py 1.2.0-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 2,560 kB
  • sloc: python: 1,841; makefile: 42; sh: 21
file content (22 lines) | stat: -rw-r--r-- 498 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# -*- coding: utf-8 -*-

from __future__ import absolute_import

from .base import Type


class Wasm(Type):
    """Implements the Wasm image type matcher."""

    MIME = 'application/wasm'
    EXTENSION = 'wasm'

    def __init__(self):
        super(Wasm, self).__init__(
            mime=Wasm.MIME,
            extension=Wasm.EXTENSION
        )

    def match(self, buf):
        return buf[:8] == bytearray([0x00, 0x61, 0x73, 0x6d,
                                     0x01, 0x00, 0x00, 0x00])