MCPcopy Index your code
hub / github.com/nodejs/node / bitwise_and

Function bitwise_and

deps/v8/tools/windbg.js:204–216  ·  view source on GitHub ↗
(l, r)

Source from the content-addressed store, hash-verified

202// JS doesn't do bitwise operations on large integers, so let's do it ourselves
203// using hex string representation.
204function bitwise_and(l, r) {
205 l = hex(l);
206 let l_length = l.length;
207 r = hex(r);
208 let r_length = r.length;
209 let res = "";
210 let length = Math.min(l_length, r_length) - 2; // to account for "0x"
211 for (let i = 1; i <= length; i++) {
212 res = (parseInt(l[l_length - i], 16) & parseInt(r[r_length - i], 16))
213 .toString(16) + res;
214 }
215 return parseInt(res, 16);
216}
217
218
219/*=============================================================================

Callers 1

set_isolate_addressFunction · 0.85

Calls 3

hexFunction · 0.70
minMethod · 0.45
toStringMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…