Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Process message into chunks
- def chunkMessage( str )
- nblk = ((str.length + 8) >> 6) + 1
- blks = Array.new(nblk * 16) { 0 }
- i = 0
- while i < str.length do
- blks[i >> 2] |= str[i].ord << ((i % 4) * 8)
- i += 1
- end
- blks[i >> 2] |= 0x80 << ((i % 4) * 8)
- blks[nblk * 16 - 2] = str.length * 8
- return blks
- end
Advertisement
Add Comment
Please, Sign In to add comment