Lines Matching defs:buf

248 static size_t hex_decode(char* buf,
258 buf[i] = (a << 4) | b;
265 Isolate* isolate, char* buf, size_t buflen, Local<String> str, int flags) {
266 uint16_t* const dst = reinterpret_cast<uint16_t*>(buf);
296 memcpy(buf + nchars * sizeof(*dst), &last, sizeof(last));
303 char* buf,
323 memcpy(buf, ext->data(), nbytes);
325 uint8_t* const dst = reinterpret_cast<uint8_t*>(buf);
332 nbytes = str->WriteUtf8(isolate, buf, buflen, nullptr, flags);
336 nbytes = WriteUCS2(isolate, buf, buflen, str, flags);
343 SwapBytes16(buf, nbytes);
353 nbytes = base64_decode(buf, buflen, ext->data(), ext->length());
356 nbytes = base64_decode(buf, buflen, *value, value.length());
363 nbytes = hex_decode(buf, buflen, ext->data(), ext->length());
366 nbytes = hex_decode(buf, buflen, *value, value.length());
558 const char* buf,
573 auto maybe_buf = Buffer::Copy(isolate, buf, buflen);
574 Local<v8::Object> buf;
575 if (!maybe_buf.ToLocal(&buf)) {
578 return buf;
582 if (simdutf::validate_ascii_with_errors(buf, buflen).error) {
589 force_ascii(buf, out, buflen);
592 return ExternOneByteString::NewFromCopy(isolate, buf, buflen, error);
598 buf,
609 return ExternOneByteString::NewFromCopy(isolate, buf, buflen, error);
619 size_t written = base64_encode(buf, buflen, dst, dlen);
633 size_t written = base64_encode(buf, buflen, dst, dlen, Base64Mode::URL);
646 size_t written = hex_encode(buf, buflen, dst, dlen);
663 const uint8_t hi = static_cast<uint8_t>(buf[i + 1]);
664 const uint8_t lo = static_cast<uint8_t>(buf[i + 0]);
669 if (reinterpret_cast<uintptr_t>(buf) % 2 != 0) {
676 memcpy(dst, buf, buflen);
681 isolate, reinterpret_cast<const uint16_t*>(buf), str_len, error);
691 const uint16_t* buf,
708 memcpy(dst, buf, nbytes);
712 return ExternTwoByteString::NewFromCopy(isolate, buf, buflen, error);
717 const char* buf,
720 const size_t len = strlen(buf);
721 return Encode(isolate, buf, len, encoding, error);