Peach :: Transformers :: crypto :: UnixMd5Crypt :: Class UnixMd5Crypt
[hide private]

Class UnixMd5Crypt

source code


UNIX style MD5 crypt. If no salt is specified will use first two chars of data, ala pwd style.

From underlying docs:

unix_md5_crypt() provides a crypt()-compatible interface to the rather new MD5-based crypt() function found in modern operating systems. It's based on the implementation found on FreeBSD 2.2.[56]-RELEASE and contains the following license in it:

"THE BEER-WARE LICENSE" (Revision 42): <phk@login.dknet.dk> wrote this file. As long as you retain this notice you can do whatever you want with this stuff. If we meet some day, and you think this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp

Instance Methods [hide private]
 
__init__(self, salt=None, magic=None)
Create Transformer object.
source code
string
realEncode(self, data)
Override this to implement your transform.
source code

Inherited from transformer.Transformer: decode, encode, getAnotherTransformer, realDecode, setAnotherTransformer, transform

Static Methods [hide private]
 
unittest() source code
Class Variables [hide private]
  _salt = None
  _magic = None
Method Details [hide private]

__init__(self, salt=None, magic=None)
(Constructor)

source code 

Create Transformer object.

Parameters:
  • salt (string) - Salt for crypt (optional)
  • magic (string) - Magic, usually $1$ on unix (optional)
Overrides: transformer.Transformer.__init__

realEncode(self, data)

source code 

Override this to implement your transform.

Parameters:
  • data - Data to transform
Returns: string
transformed data
Overrides: transformer.Transformer.realEncode
(inherited documentation)