anyl-wallet icon indicating copy to clipboard operation
anyl-wallet copied to clipboard

Get rid of Magic number in the code

Open MohitKAgnihotri opened this issue 6 years ago • 2 comments

At the moment, we are using a lot of magic numbers in the code. I would recommend that we start using Macro defines for these magic numbers. This would increase the readability and maintainability of the code.

MohitKAgnihotri avatar Oct 28 '18 12:10 MohitKAgnihotri

Can you provide link to the files in which the magic numbers do occur?

pcppcp avatar Oct 28 '18 14:10 pcppcp

There are many examples but here are few to mention:

  • address.c -- keccak_256(pubkey+1, 64, hash); -- memcpy(addr_out, hash+12, 20);
  • sign.c -- function: eth_sign -- signature[64] = pby + 27;

MohitKAgnihotri avatar Oct 28 '18 15:10 MohitKAgnihotri