Skip to main content
  • Home
  • login
  • Browse the archive

    swh mirror partner logo
swh logo
SoftwareHeritage
Software
Heritage
Mirror
Features
  • Search

  • Downloads

  • Save code now

  • Add forge now

  • Help

  • 72e1ac8
  • /
  • z.pl
Raw File
Permalinks

To reference or cite the objects present in the Software Heritage archive, permalinks based on SoftWare Hash IDentifiers (SWHIDs) must be used.
Select below a type of object currently browsed in order to display its associated SWHID and permalink.

  • content
  • directory
content badge Iframe embedding
swh:1:cnt:8bba1bdbd2abb970b8fb6d308bed07349b931a58
directory badge Iframe embedding
swh:1:dir:72e1ac845e1e2c2c3aa79ef56db7ae5647a322dc
z.pl
#!/usr/local/bin/perl

use ExtUtils::testlib;

use SSLeay;
use Benchmark;

$buf=('x' x (1024*1024));
$buf=('x' x (1024*1024));

@md=();
foreach $name ("md2", "mdc2", "sha", "ripemd160", "sha1", "md5")
	{
	if (($name eq "md2") || ($name eq "mdc2"))
		{ $num=5; }
	else	{ $num=100; }

	$t=timeit($num,'&hash($name)');
	printf "%6d000 bytes/sec:$name\n",int(($num*1024*1024)/$t->[1]/1000);
	}

sub hash
	{
	my($name)=@_;
	my($f,$digest);

	($f=MD->new($name)) ||
		die "$_ is an unknown message digest algorithm\n";
	$f->update($buf);
	$digest=$f->final();
	}

ENEA — Copyright (C), ENEA. License: GNU AGPLv3+.
Legal notes  ::  JavaScript license information ::  Web API

back to top