MCPcopy Create free account
hub / github.com/Vishal-raj-1/Awesome-JavaScript-Projects / BinaryToGray

Function BinaryToGray

assets/js/Code_Converter.js:38–46  ·  view source on GitHub ↗
(binary)

Source from the content-addressed store, hash-verified

36}
37
38function BinaryToGray(binary){ //Binary to Gray Function
39binary = binary.split('');
40let gray='';
41gray += binary[0];
42for(let i=1;i<binary.length;i++){
43 gray+=xor_c(binary[i-1],binary[i]);
44}
45 return gray;
46}
47
48function GrayToBinary(gray){ //Gray to Binary Function
49let binary='';

Callers 1

displayFunction · 0.85

Calls 1

xor_cFunction · 0.85

Tested by

no test coverage detected