diff options
author | Luca Casonato <hello@lcas.dev> | 2024-08-02 16:23:21 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-08-02 16:23:21 +0200 |
commit | 7495bcbf77349d708b249944a149c16f5ee0c667 (patch) | |
tree | d6b1250478c1d3b5b4670bfb8e90debf841a4bbc /ext/node/polyfills/internal_binding | |
parent | e24aa6bbeca265454fea3592fc9fc18e6312556e (diff) |
Revert "perf(ext/node): improve `Buffer` from string performance" (#24851)
Diffstat (limited to 'ext/node/polyfills/internal_binding')
-rw-r--r-- | ext/node/polyfills/internal_binding/_utils.ts | 17 |
1 files changed, 0 insertions, 17 deletions
diff --git a/ext/node/polyfills/internal_binding/_utils.ts b/ext/node/polyfills/internal_binding/_utils.ts index 0b1e1709d..74dc3cbcd 100644 --- a/ext/node/polyfills/internal_binding/_utils.ts +++ b/ext/node/polyfills/internal_binding/_utils.ts @@ -7,7 +7,6 @@ import { forgivingBase64Decode, forgivingBase64UrlDecode, } from "ext:deno_web/00_infra.js"; -import { op_base64_write } from "ext:core/ops"; export function asciiToBytes(str: string) { const length = str.length; @@ -28,22 +27,6 @@ export function base64ToBytes(str: string) { } } -export function base64Write( - str: string, - buffer: Uint8Array, - offset: number = 0, - length?: number, -): number { - length = length ?? buffer.byteLength - offset; - try { - return op_base64_write(str, buffer, offset, length); - } catch { - str = base64clean(str); - str = str.replaceAll("-", "+").replaceAll("_", "/"); - return op_base64_write(str, buffer, offset, length); - } -} - const INVALID_BASE64_RE = /[^+/0-9A-Za-z-_]/g; function base64clean(str: string) { // Node takes equal signs as end of the Base64 encoding |