How to use the alloc function from buffer

Find comprehensive JavaScript buffer.alloc code examples handpicked from public code repositorys.

126
127
128
129
130
131
132
133
134
135
136
137
138


ip.mask = function(addr, mask) {
  addr = ip.toBuffer(addr);
  mask = ip.toBuffer(mask);


  var result = Buffer.alloc(Math.max(addr.length, mask.length));


  var i = 0;
  // Same protocol - do bitwise and
  if (addr.length === mask.length) {
fork icon13
star icon24
watch icon1

+ 3 other calls in file