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

72
Visualizações
Generate fixed length unique string from 2

I have two numbers 919572562474827787 and 359678229096955904

I need to generate a unique string with fixed length so I can regenerate it again and get the same value. How can I do it?

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

0

You can do this with built-in functions from SubtleCrypto.

This function will return a cryptographically secure SHA-256 hash of the numbers. This will work independent of the system you run this with, and return the same output for the same input.

const hash = async (number1, number2) => btoa(String.fromCharCode.apply(null, new Uint8Array(await crypto.subtle.digest("SHA-256", new TextEncoder().encode(number1+number2)))))

hash("919572562474827787","359678229096955904").then(console.log)

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