Skip to content

Instantly share code, notes, and snippets.

@viniceosm
Created October 30, 2019 10:53
Show Gist options
  • Save viniceosm/bd5d5eb13f9e46afa262773e06e704af to your computer and use it in GitHub Desktop.
Save viniceosm/bd5d5eb13f9e46afa262773e06e704af to your computer and use it in GitHub Desktop.
hamming
var codigo = '10011000';
function posicaoBitsVerificadores (codigo) {
var maxPosicao = 0, i = 0;
var posicoesBit = [];
do {
maxPosicao = 2 ** i;
posicoesBit.push(maxPosicao);
i++;
} while (maxPosicao < codigo.length);
return posicoesBit;
}
posicaoBitsVerificadores(codigo);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment