How to use the qrloop/importer.framesToData function in qrloop

To help you get started, we’ve selected a few qrloop examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github LedgerHQ / ledger-live-mobile / src / screens / ImportAccounts / Scan.js View on Github external
onBarCodeRead = ({ data }: { data: string }) => {
    if (data && data !== this.lastData && !this.completed) {
      this.lastData = data;
      try {
        this.frames = parseFramesReducer(this.frames, data);

        this.setState({ progress: progressOfFrames(this.frames) });

        if (areFramesComplete(this.frames)) {
          try {
            this.onResult(decode(framesToData(this.frames).toString()));
            this.completed = true;
          } catch (error) {
            this.frames = null;
            this.setState({ error, progress: 0 });
          }
        }
      } catch (e) {
        console.warn(e);
      }
    }
  };
github LedgerHQ / ledger-live-mobile / src / screens / ImportAccounts / Scan.js View on Github external
componentDidMount() {
    const { navigation } = this.props;
    const data = navigation.getParam("data");
    if (data) {
      const frames = data.reduce(parseFramesReducer, null);
      if (areFramesComplete(frames)) {
        this.onResult(decode(framesToData(frames).toString()));
      }
    }
  }

qrloop

Envelop big blob of data into frames that can be displayed in series of QR Codes

MIT
Latest version published 2 years ago

Package Health Score

45 / 100
Full package analysis