Exemplo n.º 1
0
 def to_string(self):
     salt = self.salt
     chk = salt[:2] + (self.checksum or self._stub_checksum)
     if self.use_duplicate_salt:
         # filling in salt field, so that we're compatible with django 1.0
         return uh.render_mc2(self.ident, salt, chk)
     else:
         # django 1.4+ style hash
         return uh.render_mc2(self.ident, "", chk)
Exemplo n.º 2
0
 def to_string(self):
     salt = self.salt
     chk = salt[:2] + self.checksum
     if self.use_duplicate_salt:
         # filling in salt field, so that we're compatible with django 1.0
         return uh.render_mc2(self.ident, salt, chk)
     else:
         # django 1.4+ style hash
         return uh.render_mc2(self.ident, "", chk)
Exemplo n.º 3
0
 def to_string(self):
     return uh.render_mc2(self.ident, self.salt, self.checksum)
Exemplo n.º 4
0
 def to_string(self):
     return uh.render_mc2(self.ident, self.salt,
                          self.checksum or self._stub_checksum)
Exemplo n.º 5
0
 def to_string(self):
     # NOTE: always filling in salt field, so that we're compatible
     # with django 1.0 (which requires it)
     salt = self.salt
     chk = salt[:2] + (self.checksum or self._stub_checksum)
     return uh.render_mc2(self.ident, salt, chk)
Exemplo n.º 6
0
 def to_string(self):
     """Render instance to configuration string in Modular Crypt Format."""
     return render_mc2(self.ident, self.salt, self.checksum)
Exemplo n.º 7
0
 def format_hash(cls, _salt, _checksum):
     return render_mc2(cls.ident, b64encode(_salt).decode('utf-8'), _checksum)
Exemplo n.º 8
0
 def format_hash(cls, _checksum):
     return render_mc2(cls.ident, cls._generate_salt(), _checksum)
Exemplo n.º 9
0
 def to_string(self):
     # NOTE: always filling in salt field, so that we're compatible
     # with django 1.0 (which requires it)
     salt = self.salt
     chk = salt[:2] + (self.checksum or self._stub_checksum)
     return uh.render_mc2(self.ident, salt, chk)