MCPcopy Create free account
hub / github.com/CreditTone/hooker / stringToBytes

Function stringToBytes

js/hook_encryption_algo.js:133–146  ·  view source on GitHub ↗
(str)

Source from the content-addressed store, hash-verified

131 return val
132}
133function stringToBytes(str) {
134 var ch, st, re = [];
135 for (var i = 0; i < str.length; i++) {
136 ch = str.charCodeAt(i);
137 st = [];
138 do {
139 st.push(ch & 0xFF);
140 ch = ch >> 8;
141 }
142 while (ch);
143 re = re.concat(st.reverse());
144 }
145 return re;
146}
147//将byte[]转成String的方法
148function bytesToString(arr) {
149 var str = '';

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected