Removed all code that uses OpenGL from Image.
[io/quag.git] / addons / MD5 / samples / md5.io
blob9d19446ed6f59840341a3b04413f0ba6fe70ccbc
1 #!/usr/bin/env io
3 File md5String := method(
4 digest := MD5 clone
5 buffer := Buffer clone
7 openForReading
8 while(isAtEnd == nil,
9 readToBufferLength(buffer, 65536)
10 digest appendSeq(buffer)
12 close
13 digest md5String
16 if (?args == nil or args size == 0,
17 write("requires a file name as an argument\n")
18 exit
21 f := File clone setPath(args at(0))
22 m1 := f md5String
23 m2 := f asBuffer md5String
24 write("md5 = ", m1, "\n")
25 write("md5 = ", m2, " \n")
26 write(if(m1 == m2, "PASSED", "FAILED"), " TEST\n")