How to use the pouchdb-md5.binaryMd5 function in pouchdb-md5

To help you get started, we’ve selected a few pouchdb-md5 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 pouchdb / pouchdb / packages / node_modules / pouchdb-adapter-utils / src / preprocessAttachments.js View on Github external
function preprocessString(att, blobType, callback) {
  var asBinary = parseBase64(att.data);
  if (asBinary.error) {
    return callback(asBinary.error);
  }

  att.length = asBinary.length;
  if (blobType === 'blob') {
    att.data = binStringToBlobOrBuffer(asBinary, att.content_type);
  } else if (blobType === 'base64') {
    att.data = btoa(asBinary);
  } else { // binary
    att.data = asBinary;
  }
  binaryMd5(asBinary, function (result) {
    att.digest = 'md5-' + result;
    callback();
  });
}
github pouchdb / pouchdb / packages / node_modules / pouchdb-adapter-utils / src / preprocessAttachments.js View on Github external
function preprocessBlob(att, blobType, callback) {
  binaryMd5(att.data, function (md5) {
    att.digest = 'md5-' + md5;
    // size is for blobs (browser), length is for buffers (node)
    att.length = att.data.size || att.data.length || 0;
    if (blobType === 'binary') {
      blufferToBinaryString(att.data, function (binString) {
        att.data = binString;
        callback();
      });
    } else if (blobType === 'base64') {
      blufferToBase64(att.data, function (b64) {
        att.data = b64;
        callback();
      });
    } else {
      callback();
    }
github stockulus / pouchdb-react-native / packages / pouchdb-adapter-leveldb-core-rn / lib / index.js View on Github external
return function (data) {
          pouchdbMd5.binaryMd5(data, onMD5Load(doc, key, data, attachmentSaved));
        };
      }
github pouchdb / pouchdb / packages / node_modules / pouchdb-generate-replication-id / src / index.js View on Github external
return new Promise(function (resolve) {
      binaryMd5(queryData, resolve);
    });
  }).then(function (md5sum) {
github stockulus / pouchdb-react-native / packages / pouchdb-adapter-leveldb-core-rn / src / index.js View on Github external
return function (data) {
          binaryMd5(data, onMD5Load(doc, key, data, attachmentSaved))
        }
      }
github stockulus / pouchdb-react-native / packages / pouchdb-adapter-leveldb-core-rn / lib / index-browser.js View on Github external
return function (data) {
          pouchdbMd5.binaryMd5(data, onMD5Load(doc, key, data, attachmentSaved));
        };
      }
github pouchdb / pouchdb / packages / node_modules / pouchdb-adapter-indexeddb / src / bulkDocs.js View on Github external
return new Promise(function (resolve) {
      md5(binData, function (result) {
        attachment.digest = 'md5-' + result;
        attachment.length = binData.size || binData.length || 0;
        resolve(attachment);
      });
    });
  }

pouchdb-md5

PouchDB utilities for calculating MD5 checksums.

Apache-2.0
Latest version published 6 months ago

Package Health Score

85 / 100
Full package analysis

Popular pouchdb-md5 functions