As an excel/libreoffice formula:
# cell A1 1295576502 =FLOOR(LEN(A1)*LOG(LEN(A1)-1,2)) # result is: 31
check: 2^30=1073741824; 2^31 = 2147483648; ok.