Question: Calculate message's bits

>message:=`67A`;

67A

>P:=convert(message, bytes);

[54, 55, 65]

>with(Bits):

>bitP1:=Split(P1);

[0, 1, 1, 0, 1, 1]

>bitP2:=Split(P2);

[1, 1, 1, 0, 1, 1]

>bitP3:=Split(P3);

[1, 0, 0, 0, 0, 0, 1]

>with(Statistics):

>b1:=Count(bitP1);

6

>b2:=Count(bitP2);

6

>b3:=Count(bitP3);

7

>totalBits=b1+b2+b3;

19

 

Hi, how i need to modify my command so when i write any message with any lenght, i can get the totalBits directly..

Thank you~=]]

Please Wait...