Anonymous user
MD5/Implementation: Difference between revisions
Updated to work with Nim 1.4: replaced ".. <" with "..<".
m (→{{header|Wren}}: Removed a superfluous comma.) |
(Updated to work with Nim 1.4: replaced ".. <" with "..<".) |
||
Line 3,666:
srcIndex = offset
for dstIndex in 0 ..
chunk[dstIndex] = 0
for ii in 0 ..
chunk[dstIndex] = chunk[dstIndex] shr 8
chunk[dstIndex] = chunk[dstIndex] or (msg[srcIndex].uint32 shl 24)
Line 3,722:
var sizePadding = newSeq[uint8](8)
var size = msg.len * 8
for ii in 0 ..
sizePadding[ii] = uint8(size and 0xff)
size = size shr 8
Line 3,776:
var tmp = acc
for ii in 0 ..
result[dstIdx] = uint8(tmp and 0xff)
tmp = tmp shr 8
Line 3,783:
# Only needed to convert from string to uint8 sequence
iterator items * (str : string) : uint8 =
for ii in 0 ..
yield str[ii].uint8
|