mwg API
    Preparing search index...

    Function detectRomImage

    • Decides whether bytes are an instrument ROM image, which a package must never carry. The answer is a registered digest, a .rom extension, or an exact ROM size with no recognised format signature and no text in it. null means nothing suggests a ROM.

      Parameters

      • bytes: Uint8Array
      • name: string = 'data'

      Returns Promise<RomDetection | null>

      import { detectRomImage } from '@datamoc/mwg/mwl';

      const refusal = await detectRomImage(new Uint8Array(65536).fill(0xa5), 'pcm.bin');
      console.log(refusal?.reason); // 'size'