MCPcopy Create free account
hub / github.com/OpenSIST/OpenSIST.github.io / getUtf8ByteLength

Function getUtf8ByteLength

src/Data/PostData.js:8–10  ·  view source on GitHub ↗
(value = "")

Source from the content-addressed store, hash-verified

6const textEncoder = new TextEncoder();
7
8export function getUtf8ByteLength(value = "") {
9 return textEncoder.encode(value ?? "").length;
10}
11
12export function formatPostContentSize(bytes) {
13 return `${(bytes / 1000 / 1000).toFixed(2)} MB`;

Callers 4

getEstimatedDataUrlBytesFunction · 0.90
handleSubmitFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected