MD5/Implementation: Difference between revisions
→{{header|EasyLang}}
(→{{header|Scala}}: mark as incorrect) |
|||
Line 1,602:
<syntaxhighlight lang="text">
len md5k[] 64
func md5init . .
for i = 1 to 64▼
md5k[i] = floor (0x100000000 * abs sin (i * 180 / pi))▼
▲ for i = 1 to 64
▲ md5k[i] = floor (0x100000000 * abs sin (i * 180 / pi))
for j = 0 to 3▼
for k = 0 to 3▼
md5s[i * 16 + j * 4 + k + 1] = s[i * 4 + k + 1]▼
▲ .
.▼
.
call md5init
#
func md5 inp$ . s$ .
subr addinp
if inp4 = 1
inp[] &= 0
.
inp[len inp[]] += b * inp4
inp4 *= 0x100
if inp4 = 0x100000000
inp4 = 1
.
.
s[] = [ 7 12 17 22 7 12 17 22 7 12 17 22 7 12 17 22 5 9 14 20 5 9 14 20 5 9 14 20 5 9 14 20 4 11 16 23 4 11 16 23 4 11 16 23 4 11 16 23 6 10 15 21 6 10 15 21 6 10 15 21 6 10 15 21 ]
for
b = strcode substr inp$ i 1
call addinp▼
call addinp
▲ call addinp
while len inp[] mod 16 <> 14 or inp4 <> 1
▲ b = 0
call addinp▼
▲ .
h = len inp$ * 8
for
▲ call addinp
d0 = 0x10325476
for
else▼
g = (7 * i - 7) mod 16
h1 = bitshift f s[i]
h2 = bitshift f (s[i] - 32)
.
for a in
for h in [ b div 16 b mod 16 ]
if h > 57▼
s$ &= strchar h
▲ a = a div 256
▲ for h in [ b div 16 b mod 16 ]
▲ h += 48
▲ if h > 57
▲ h += 39
▲ s$ &= strchar h
.
.
repeat
s$ = input
until error = 1
call md5 s$ h$
print h$
.
input_data
|