Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

688
Visualizações
What is the JavaScript/node.js function HMACSHA256()?

I am trying to find information about this JavaScript/node.js function:

HMACSHA256()

Its mentioned e.g. here:

  • https://jwt.io/introduction (scroll to section "Signature")

  • https://hirosht.medium.com/customized-jwt-encoded-with-hmac-sha256-hs256-267574bd7639 (scroll to section "Signature;")

It's mentioned in other places too.

Neither node.js nor any browser JavaScript provides any function with that name.

So what is it? Is it pseudo code or is it a dummy function or simply a mistake everybody copies and pastes?

about 4 years ago · Juan Pablo Isaza
2 Respostas
Responde à pergunta

0

You need a plugin named "crypto" It has "createHmac" function where you can give "sha256" as an argument.

https://nodejs.org/api/crypto.html#cryptocreatehmacalgorithm-key-options

about 4 years ago · Juan Pablo Isaza Relatório

0

It is a standard algorithum.

The JWT documentation is providing psuedo-code (and also links off to JWT specific libraries that you should probably be using instead of writing your own implementation).

The blog you've found has code examples using Crypto-JS

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda