Most of Buffer.toString

This commit is contained in:
Jarred Sumner
2022-04-26 01:12:28 -07:00
parent 6590d1f8bf
commit 77fbfb3fbb
10 changed files with 288 additions and 11 deletions

View File

@@ -1,6 +1,14 @@
#include "wtf-bindings.h"
#include "wtf/text/Base64.h"
extern "C" void WTF__copyLCharsFromUCharSource(LChar* destination, const UChar* source, size_t length)
{
WTF::copyLCharsFromUCharSource(destination, source, length);
}
extern "C" JSC::EncodedJSValue WTF__toBase64URLStringValue(const uint8_t* bytes, size_t length, JSC::JSGlobalObject* globalObject)
{
WTF::String string = WTF::base64URLEncodeToString(reinterpret_cast<const LChar*>(bytes), static_cast<unsigned int>(length));
string.impl()->ref();
return JSC::JSValue::encode(JSC::jsString(globalObject->vm(), string.impl()));
}