GSoC/GCI Archive
Google Code-in 2010 Parrot Foundation and The Perl Foundation

Use MappedByteArray for MD5 checksum calculation

completed by: David Czech

mentors: whiteknight

Task Description: The MappedByteArray PMC is a new data type built into Parrot that allows the user to memory-map a file and access the contents of a file through normal memory operations. In some usage scenarios this is much faster and much easier than doing normal file IO directly to disk. The MappedByteArray is new, experimental, and mostly untested. We need tests and examples written for it to help verify it's behavior.

Currently, the MappedByteArray PMC type is only implemented for Unix, Linux, and similar systems with POSIX support.

Write a function to calculate the MD5 checksum of a file opened using a MappedByteArray PMC. You can use any language of your choice which runs on Parrot (NQP, Rakudo Perl 6, Winxed, PIR, etc).

Steps to Compete:

  1. Write an example program to calculate the MD5 sum of a file using the MappedByteArray
  2. Compare your output results with a known MD5 sum of a test file
  3. When complete, submit your work.

Notice: Because the MappedByteArray PMC is new, you may identify bugs in it that prevent you from completing this task normally. If you run into any bugs of this nature, open a ticket for the issue on trac.parrot.org and include the code you were using when you found the bug and the text of the error message you received, if any. If the bug is valid and does prevent you from normal task completion, that will be considered a satisfactory result and this task will be closed and accepted.

Links: https://github.com/parrot/parrot/blob/master/src/pmc/mappedbytearray.pmc, http://en.wikipedia.org/wiki/MD5, http://trac.parrot.org/parrot