From 729d445b6885f69dd2c6355f38707bd42851c791 Mon Sep 17 00:00:00 2001 From: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> Date: Wed, 22 Jun 2022 23:21:48 -0700 Subject: change the directory structure --- src/bun.js/bindings/wtf-bindings.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 src/bun.js/bindings/wtf-bindings.cpp (limited to 'src/bun.js/bindings/wtf-bindings.cpp') diff --git a/src/bun.js/bindings/wtf-bindings.cpp b/src/bun.js/bindings/wtf-bindings.cpp new file mode 100644 index 000000000..d715f4d45 --- /dev/null +++ b/src/bun.js/bindings/wtf-bindings.cpp @@ -0,0 +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(bytes), static_cast(length)); + string.impl()->ref(); + return JSC::JSValue::encode(JSC::jsString(globalObject->vm(), string)); +} \ No newline at end of file -- cgit v1.2.3