Skip to main content
. 2022 Sep 8;22(18):6806. doi: 10.3390/s22186806
Algorithm 4: Convert from address to byte
Begin
  bytes memory baddr = FromAddressToBytes(addr); // Call Method that convert
    bytes memory res = new bytes (1 + 1 + 20);
   uint i = 0;
    res[i++] = byte(v1);
    res[i++] = byte(v2);
    uint j = 0;
    for (j = 0; j < n; j++)
  {
     res[i++] = baddr[j];
  }
      return res;
  End;