Matt S Trout > Rakudo-Star-2012.08_001 > sha256.pir

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

Annotate this POD

Source  

NAME ^

sha256.pir - calculates message digest checksums

SYNOPSIS ^

  load_bytecode "Digest/sha256.pbc"
  $P0 = sha256sum("foo")
  sha256_print($P0)

or

  load_bytecode "Digest/sha256.pbc"
  $P0 = sha256sum("bar")
  $S0 = sha256_hex($P0)

or using the object oriented interface:

  load_bytecode "Digest/sha256.pbc"
  $P0 = new ['Digest';"SHA256"]
  $P0."sha_sum"("blah")
  $P0."sha_print"()

DESCRIPTION ^

This is a pure Parrot sha256 hash routine.

SUBROUTINES ^

sha256sum

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

sha256_hex

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

sha256_print

Pass it the Integer array to print the checksum.

BUGS ^

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

sha256sum( str )

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

sha256_hex( )

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

sha256_print( )

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

syntax highlighting: