MCPcopy Create free account
hub / github.com/circircir-circle/human_exist_device / stringToBytes

Function stringToBytes

mini_program/pages/index.js:258–265  ·  view source on GitHub ↗
(str)

Source from the content-addressed store, hash-verified

256 })
257 },
258 stringToBytes(str) {
259 var array = new Uint8Array(str.length);
260 for (var i = 0, l = str.length; i < l; i++) {
261 array[i] = str.charCodeAt(i);
262 }
263 console.log(array);
264 return array.buffer;
265 },
266 hextoString: function (hex) {
267 var arr = hex.split("")
268 var out = ""

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected