convert_36_to_10() {
_c2n() {
awk 'BEGIN{print index("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ","'$1'")-1}'
}
local s=0 i=0 B=36 c= n=
while [ $i -lt ${#1} ]; do
c=${1:$i:1}
n=$(_c2n $c)
((s = s * B + n))
# printf 'pos=%s,org=%s,num=%-2d,sum=%s\n' $i $c $f $s
((i++))
done
echo "${1}-->$s"
}
04-10
1122
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
05-17
672
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
“相关推荐”对你有帮助么?
-
非常没帮助
-
没帮助
-
一般
-
有帮助
-
非常有帮助
提交