INNER CODE UNIT · JavaScript

setStatus

dfinity/examples · motoko/vetkeys/basic_vetkd/frontend/src/main.js:36

function setStatus(id, msg) {
  const el = document.getElementById(id);
  if (el) el.textContent = msg;
}

function getInputValue(id) {
  return document.getElementById(id)?.value ?? "";
}

function hexEncode(bytes) {
  return Array.from(bytes)
    .map((b) => b.toString(16).padStart(2, "0"))
    .join("");
}

function hexDecode(str) {
  const matches = str.match(/.{1,2}/g);
  if (!matches) throw new Error("Invalid hex string");

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…