(att, blobType, callback)
| 4408 | } |
| 4409 | |
| 4410 | function preprocessString(att, blobType, callback) { |
| 4411 | var asBinary = parseBase64(att.data); |
| 4412 | if (asBinary.error) { |
| 4413 | return callback(asBinary.error); |
| 4414 | } |
| 4415 | |
| 4416 | att.length = asBinary.length; |
| 4417 | if (blobType === 'blob') { |
| 4418 | att.data = binStringToBluffer(asBinary, att.content_type); |
| 4419 | } else if (blobType === 'base64') { |
| 4420 | att.data = thisBtoa(asBinary); |
| 4421 | } else { // binary |
| 4422 | att.data = asBinary; |
| 4423 | } |
| 4424 | binaryMd5(asBinary, function (result) { |
| 4425 | att.digest = 'md5-' + result; |
| 4426 | callback(); |
| 4427 | }); |
| 4428 | } |
| 4429 | |
| 4430 | function preprocessBlob(att, blobType, callback) { |
| 4431 | binaryMd5(att.data, function (md5) { |
no test coverage detected
searching dependent graphs…