Hexadecimal Hijinks

I've invented a new hash algorithm, Insecure Hash Algorithm (IHA-1). It takes a bit string of any length as input, and produces a 60 bit output. I want to print the output as a string of hexadecimal digits. How many hexadecimal digits are required to print any output?

Image credit: CC BY-NC 2.0


The answer is 15.

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

1 solution

Akhilesh Agrawal
Jul 17, 2014

To convert binary to hexadecimal, first divide the whole binary digit into groups of 4 from left. Each binary digit is assigned with a hexadecimal digit (0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F). For eg , 0=0000, 1=0001, 2=0010, ........9=1001, A=1010,.........F=1111. Now it is given that the string is of 60 bit i.e it has 60 binary digits. For maximum value put it 11111111111111.....(60 times). Divide it into 4 groups. So its corresponding hexadecimal digit is FFFFFFF............(15 times). So maximum number of digits is 15

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...