This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
two test failures
[perl5.git] / t / op / crypt.t
CommitLineData
85c16d83 1use Test::More tests => 2;
17f79ebb 2use Config;
85c16d83
JH
3
4# Can't assume too much about the string returned by crypt(),
5# and about how many bytes of the encrypted (really, hashed)
6# string matter.
7#
8# HISTORICALLY the results started with the first two bytes of the salt,
9# followed by 11 bytes from the set [./0-9A-Za-z], and only the first
10# eight characters mattered, but those are probably no more safe
11# bets, given alternative encryption/hashing schemes like MD5,
12# C2 (or higher) security schemes, and non-UNIX platforms.
13
17f79ebb
JH
14SKIP: {
15 skip "crypt unimplemented", 2, unless $Config{d_crypt};
16
17 ok(substr(crypt("ab", "cd"), 2) ne substr(crypt("ab", "ce"), 2), "salt");
85c16d83 18
17f79ebb
JH
19 ok(crypt("HI", "HO") eq crypt(v4040.4041, "HO"), "Unicode");
20}