about summary refs log tree commit diff stats
path: root/src/html
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2024-04-21 18:59:06 +0200
committerbptato <nincsnevem662@gmail.com>2024-04-21 18:59:06 +0200
commitbe777fc6bda37ff16afb2238f5192a5076a67188 (patch)
tree31f9c12783de23723aff4cae2f698ac9e7432633 /src/html
parent7802c914b3b25b4149a8f1333e41550733042820 (diff)
downloadchawan-be777fc6bda37ff16afb2238f5192a5076a67188.tar.gz
base64: rewrite btoa too
why not
Diffstat (limited to 'src/html')
-rw-r--r--src/html/formdata.nim4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/html/formdata.nim b/src/html/formdata.nim
index c14a36ab..335e36b6 100644
--- a/src/html/formdata.nim
+++ b/src/html/formdata.nim
@@ -1,9 +1,9 @@
-import std/base64
 import std/streams
 
 import html/catom
 import html/dom
 import html/enums
+import js/base64
 import js/domexception
 import js/javascript
 import js/tojs
@@ -21,7 +21,7 @@ proc generateBoundary(): string =
   let s = urandom.readStr(32)
   urandom.close()
   # 32 * 4 / 3 (padded) = 44 + prefix string is 22 bytes = 66 bytes
-  return "----WebKitFormBoundary" & base64.encode(s)
+  return "----WebKitFormBoundary" & btoa(s)
 
 proc newFormData0*(): FormData =
   return FormData(boundary: generateBoundary())