Matt S Trout > Rakudo-Star > MD5.pir

Download:
Rakudo-Star-2012.08_001.tar.gz

Annotate this POD

Source  

NAME ^

MD5.pir - calculates MD5 checksums

SYNOPSIS ^

  load_bytecode "Digest/MD5.pbc"
  $P0 = _md5sum("foo")
  _md5_print($P0)

or

  load_bytecode "Digest/MD5.pbc"
  $P0 = _md5sum("bar")
  $S0 = _md5_hex($P0)

or using the Object interface:

  load_bytecode "Digest/MD5.pbc"
  $P0 = new ["Digest";"MD5"]
  $P1 = $P0."md5sum"("baz")
  $P0."md5_print"()

DESCRIPTION ^

This is a pure Parrot MD5 hash routine. You should run it with the JIT core if possible.

SUBROUTINES ^

_md5sum

Pass in a string, returns an Integer array with the result.

_md5_hex

Pass it the Integer array from _md5sum to get the checksum as string.

_md5_print

Pass it the Integer array to print the checksum.

METHODS ^

The MD5 class defines the following subroutines, which are very similar to the subroutine alternatives:

md5sum( str )

Pass in a string, returns an Integer array with the result, and stores the result in an attribute.

md5_hex( )

Uses the Integer array from _md5sum to return the checksum as string.

md5_print( )

Uses the Integer array from _md5sum to print the checksum. Returns the checksum as a string.

BUGS ^

Still has some limitations on input buffer size, largely due to memory consumption which should be resolved soon.

syntax highlighting: