I wanted to know how far the posix shell alone can calculate, and I wanted to know how bit calculations can be realized.(In particular, I was trying to implement sha256/md5)
I would like to achieve a 32-bit right rotation bit shift operation.How can I do this? The shell has arhythmic expansion, and the numerical type is guaranteed to be signed long, and the bit operators, so I think it will probably be possible.However, I am asking because I am wondering if I could get the bit length of long and what is the correct bit operation based on that.sh posix
I don't know what you want to do, but if it's a 32-bit integer bit shift, it's like this.(I don't think about efficiency)
I tried implementing right rotation using bit operation in
I don't know what
long looks like in
bash, but I tried to count the bit length of the integer.
The result was 64.
GNU bash, version 4.4.20(1)-release(x86_64-pc-linux-gnu)
© 2022 OneMinuteCode. All rights reserved.