MCPcopy Create free account
hub / github.com/hoothin/UserScripts / string2binary

Function string2binary

Picviewer CE+/dist.user.js:3316–3324  ·  view source on GitHub ↗

* Convert a string that pass as a "binary string": it should represent a byte * array but may have > 255 char codes. Be sure to take only the first byte * and returns the byte array. * @param {String} str the string to transform. * @return {Array|Uint8Array} the string in a binary format.

(str)

Source from the content-addressed store, hash-verified

3314 * @return {Array|Uint8Array} the string in a binary format.
3315 */
3316function string2binary(str) {
3317 var result = null;
3318 if (support.uint8array) {
3319 result = new Uint8Array(str.length);
3320 } else {
3321 result = new Array(str.length);
3322 }
3323 return stringToArrayLike(str, result);
3324}
3325
3326/**
3327 * Create a new blob with the given content and the given type.

Callers 1

dist.user.jsFile · 0.70

Calls 1

stringToArrayLikeFunction · 0.70

Tested by

no test coverage detected