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

Function writeStringToArray

bin/mongoose.debug.js:12075–12084  ·  view source on GitHub ↗
(data)

Source from the content-addressed store, hash-verified

12073 * @api private
12074 */
12075var writeStringToArray = function(data) {
12076 // Create a buffer
12077 var buffer = typeof Uint8Array != 'undefined' ? new Uint8Array(new ArrayBuffer(data.length)) : new Array(data.length);
12078 // Write the content to the buffer
12079 for(var i = 0; i < data.length; i++) {
12080 buffer[i] = data.charCodeAt(i);
12081 }
12082 // Write the string to the buffer
12083 return buffer;
12084}
12085
12086/**
12087 * Convert Array ot Uint8Array to Binary String

Callers 1

BinaryFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected