+6 votes
117 views
in Programming by (670 points)

How can i get multiple bytes from a string is too bulky.,i am using this but its too long

i need simple solution for it

var ticket = data[H]
piece += data[H+1]+data[H+2]+data[H+3]+data[H+4]+data[H+5]+data[H+6]
+data[H+7]+data[H+8]+data[H+9]+data[H+10]+data[H+11]+data[H+12]
+data[H+13]+data[H+14]+data[H+15]

1 Answer

0 votes
by (1.3k points)

You can try to have a string ticket that contains the 16 bits from H to H+15 try:

var ticket = data.slice(H, H+16);

For slice 

 

Not a Member yet?

Ask to Folks Login

My Account

Your feedback is highly appreciated