Changeset 13733 for docs/Perl6/Spec

Show
Ignore:
Timestamp:
09/29/06 22:24:39 (2 years ago)
Author:
ajs
Message:

Removing crypt per Larry. It has been moved, and is currently the only item in my yet-to-be-checked-in POSIX API doc

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • docs/Perl6/Spec/Functions.pod

    r13732 r13733  
    908908Note: Most users should just let their I/O handles autochomp instead. 
    909909(Autochomping is the default.) 
    910  
    911 =item crypt 
    912  
    913 [I don't think this should be a built-in anymore. -law] 
    914  
    915  our Str multi method p5crypt ( Str $plaintext: Str $salt ) is export(:P5) 
    916  
    917 Encrypts the string using a one-way hash function. This yields a string 
    918 which cannot be "decrypted". This is used for verifying strings such 
    919 as passwords. The C<$plaintext> is the text to be encrypted. The 
    920 C<$salt> is a string which controls how the encryption is done. Typically, 
    921 this is a random string of two characters that matches the following pattern: 
    922  
    923  token Str::CryptBasicSalt { <[./0-9A-Za-z]> **{2} } 
    924  
    925 There are other formats of salt as well, though their use is not universal. 
    926 Check your operating system's B<crypt> function for more details. Often 
    927 these other functions are used when strings of length greater than eight 
    928 are to be used (the default crypt mode only recognizes the first eight 
    929 characters of the string as significant). 
    930  
    931 If you have a previously encrypted string and a plaintext password, you 
    932 can check to see of the password is correct like so: 
    933  
    934  sub checkpw ( $encrypted, $plaintext ) { 
    935    return crypt($plaintext, $encrypted) ~~ $encrypted; 
    936  } 
    937  
    938 This works because the first part of the encrypted form of the 
    939 password is the salt, so an encrypted text can be passed in place of 
    940 the salt (everything after the salt is ignored). 
    941910 
    942911=item lc