verifySignature(data) {
    const matches = PATTERN.exec(data);
    if (!matches) {
      throw new Error(
        'SignedSource.verifySignature(...): Cannot verify signature of an ' +
          'unsigned file.'
      );
    }
    const actual = matches[1];
    // Replace signature with `NEWTOKEN` and hash to see if it matches the hash
    // in the file. For backwards compatibility, also try `OLDTOKEN`.
    return TOKENS.some(token => {
      const unsigned = data.replace(PATTERN, `${GENERATED} ${token}`);
      return hash(unsigned, 'utf8') === actual;
    });
  }
Verifies the signature in a signed file.