MCPcopy Create free account
hub / github.com/Automattic/mongoose / writeStringToArray

Function writeStringToArray

bin/mongoose.js:13661–13670  ·  view source on GitHub ↗
(data)

Source from the content-addressed store, hash-verified

13659 * @ignore
13660 */
13661var writeStringToArray = function(data) {
13662 // Create a buffer
13663 var buffer = typeof Uint8Array != 'undefined' ? new Uint8Array(new ArrayBuffer(data.length)) : new Array(data.length);
13664 // Write the content to the buffer
13665 for(var i = 0; i < data.length; i++) {
13666 buffer[i] = data.charCodeAt(i);
13667 }
13668 // Write the string to the buffer
13669 return buffer;
13670}
13671
13672/**
13673 * Convert Array ot Uint8Array to Binary String

Callers 1

BinaryFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected