/opt/canhelp/node_modules/@stablelib/base64
NameSizeModeActions
lib/-0755rm
base64.bench.ts8760644editdlrm
base64.test.ts27130644editdlrm
base64.ts97150644editdlrm
LICENSE11100644editdlrm
package.json7020644editdlrm
tsconfig.json6100644editdlrm
Edit: /opt/canhelp/node_modules/@stablelib/base64/base64.bench.ts (876B)
// Copyright (C) 2016 Dmitry Chestnykh // MIT License. See LICENSE file for details. import { encode, decode } from "./base64"; import { benchmark, report, byteSeq } from "@stablelib/benchmark"; let buf = byteSeq(1024); const encBuf = encode(buf); report("Base64 encode", benchmark(() => encode(buf), buf.length)); // Decode benchmark reports MiB/s for decoded MiB, not input. report("Base64 decode", benchmark(() => decode(encBuf), buf.length)); declare var Buffer: any; if (typeof Buffer !== "undefined") { // For comparison with Node.js buffer speed. const nodeBuf = Buffer.from(buf); const nodeEncBuf = nodeBuf.toString("base64"); report("Buffer - Base64 encode", benchmark(() => nodeBuf.toString("base64"), nodeBuf.length)); report("Buffer - Base64 decode", benchmark(() => Buffer.from(nodeEncBuf, "base64"), nodeBuf.length)); }