MD5/Implementation: Difference between revisions
Content added Content deleted
m (→{{header|Sidef}}: update) |
|||
Line 1,607: | Line 1,607: | ||
. |
. |
||
. |
. |
||
md5init |
|||
# |
# |
||
proc md5 inp$ . s$ . |
proc md5 inp$ . s$ . |
||
Line 1,625: | Line 1,625: | ||
for i = 1 to len inp$ |
for i = 1 to len inp$ |
||
b = strcode substr inp$ i 1 |
b = strcode substr inp$ i 1 |
||
addinp |
|||
. |
. |
||
b = 0x80 |
b = 0x80 |
||
addinp |
|||
while len inp[] mod 16 <> 14 or inp4 <> 1 |
while len inp[] mod 16 <> 14 or inp4 <> 1 |
||
b = 0 |
b = 0 |
||
addinp |
|||
. |
. |
||
h = len inp$ * 8 |
h = len inp$ * 8 |
||
for i = 1 to 4 |
for i = 1 to 4 |
||
b = h mod 0x100 |
b = h mod 0x100 |
||
addinp |
|||
h = h div 0x100 |
h = h div 0x100 |
||
. |
. |
||
Line 1,695: | Line 1,695: | ||
s$ = input |
s$ = input |
||
until error = 1 |
until error = 1 |
||
md5 s$ h$ |
|||
print h$ |
print h$ |
||
. |
. |