MCPcopy Index your code
hub / github.com/apache/pouchdb / binaryStringToArrayBuffer

Function binaryStringToArrayBuffer

lib/index-browser.js:805–813  ·  view source on GitHub ↗
(bin)

Source from the content-addressed store, hash-verified

803// From http://stackoverflow.com/questions/14967647/ (continues on next line)
804// encode-decode-image-with-base64-breaks-image (2013-04-21)
805function binaryStringToArrayBuffer(bin) {
806 var length = bin.length;
807 var buf = new ArrayBuffer(length);
808 var arr = new Uint8Array(buf);
809 for (var i = 0; i < length; i++) {
810 arr[i] = bin.charCodeAt(i);
811 }
812 return buf;
813}
814
815function binStringToBluffer(binString, type) {
816 return createBlob([binaryStringToArrayBuffer(binString)], {type});

Callers 1

binStringToBlufferFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…