Created
October 30, 2019 10:53
-
-
Save viniceosm/bd5d5eb13f9e46afa262773e06e704af to your computer and use it in GitHub Desktop.
hamming
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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