diff options
author | 2022-06-22 23:21:48 -0700 | |
---|---|---|
committer | 2022-06-22 23:21:48 -0700 | |
commit | 729d445b6885f69dd2c6355f38707bd42851c791 (patch) | |
tree | f87a7c408929ea3f57bbb7ace380cf869da83c0e /src/bun.js/bindings/wtf-bindings.cpp | |
parent | 25f820c6bf1d8ec6d444ef579cc036b8c0607b75 (diff) | |
download | bun-729d445b6885f69dd2c6355f38707bd42851c791.tar.gz bun-729d445b6885f69dd2c6355f38707bd42851c791.tar.zst bun-729d445b6885f69dd2c6355f38707bd42851c791.zip |
change the directory structurejarred/rename
Diffstat (limited to 'src/bun.js/bindings/wtf-bindings.cpp')
-rw-r--r-- | src/bun.js/bindings/wtf-bindings.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
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<const LChar*>(bytes), static_cast<unsigned int>(length)); + string.impl()->ref(); + return JSC::JSValue::encode(JSC::jsString(globalObject->vm(), string)); +}
\ No newline at end of file |