MD5/Implementation: Difference between revisions

Content added Content deleted
Line 4,023: Line 4,023:
{{works with|ooRexx|4.2.0 (and later)}}
{{works with|ooRexx|4.2.0 (and later)}}
<syntaxhighlight lang="oorexx">
<syntaxhighlight lang="oorexx">
#!/usr/bin/rexx
#!/usr/bin/env rexx


/* Expected results:
/* Expected results:
Line 4,097: Line 4,097:
index = 65
index = 65
end
end
-- Only proces completely filled buffer
-- Only process completely filled buffer
do while index=65
do while index=65
A = a0
A = a0
Line 4,154: Line 4,154:


-- A convenience class to encapsulate operations on non OORexx-like
-- A convenience class to encapsulate operations on non OORexx-like
-- things as little-endian 32-bit words
-- things such as little-endian 32-bit words
::class int32 public
::class int32 public


Line 4,207: Line 4,207:
bstring = bstring~substr(bits+1)~left(bstring~length,'0')
bstring = bstring~substr(bits+1)~left(bstring~length,'0')
return .int32~new(bstring~b2x~x2d)
return .int32~new(bstring~b2x~x2d)

-- For those who like to code the shift operation in a traditional way
::method '<<'
forward to (self) message("bitleft")


::method bitright -- OORexx shift (>>) implementation
::method bitright -- OORexx shift (>>) implementation
Line 4,216: Line 4,220:
bstring = bstring~left(bstring~length-bits)~right(bstring~length,fill)
bstring = bstring~left(bstring~length-bits)~right(bstring~length,fill)
return .int32~new(bstring~b2x~x2d)
return .int32~new(bstring~b2x~x2d)

-- For those who like to code the shift operation in a traditional way
::method '>>'
forward to (self) message("bitright")


::method bitnot -- OORexx not implementation
::method bitnot -- OORexx not implementation