mwg API
    Preparing search index...

    Function packageRef

    • The exact identity a save game records: id@version#sha256.

      Parameters

      Returns string

      import { encodePackage, loadPackage, packageRef } from '@datamoc/mwg/mwl';

      const source = "[{ tag: 'package', id: 'marta', version: '1.0.0' }]";
      const bytes = await encodePackage([{ path: 'content.mwl', data: new TextEncoder().encode(source) }]);
      console.log(packageRef(await loadPackage(bytes)).startsWith('marta@1.0.0#')); // true