Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

249
Views
UTF8 no está definido al generar el token SAS con Node

Estoy tratando de seguir la guía de Microsoft para generar un token SAS y aquí está mi secuencia de comandos:

 function createSharedAccessToken(uri, saName, saKey) { uri = // '...' saName = // '...' saKey = // '...' if (!uri || !saName || !saKey) { throw "Missing required parameter"; } var encoded = encodeURIComponent(uri); var now = new Date(); var week = 60 * 60 * 24 * 7; var ttl = Math.round(now.getTime() / 1000) + week; var signature = encoded + '\n' + ttl; var signatureUTF8 = utf8.encode(signature); var hash = crypto.createHmac('sha256', saKey).update(signatureUTF8).digest('base64'); return 'SharedAccessSignature sr=' + encoded + '&sig=' + encodeURIComponent(hash) + '&se=' + ttl + '&skn=' + saName; } createSharedAccessToken()

Pero estoy recibiendo un:

 var signatureUTF8 = utf8.encode(signature); ^ ReferenceError: utf8 is not defined

¿Alguna idea de por qué está sucediendo eso?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!