INNER CODE UNIT · JavaScript

getInputValue

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

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");
  return new Uint8Array(matches.map((b) => parseInt(b, 16)));
}

async function handleFetchVetKey() {
  if (!myPrincipal) {

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…