Exemple #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)
Exemple #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)
 def to_string(self):
     return uh.render_mc2(self.ident, self.salt, self.checksum)
Exemple #4
0
 def to_string(self):
     return uh.render_mc2(self.ident, self.salt,
                          self.checksum or self._stub_checksum)
Exemple #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)
Exemple #6
0
 def to_string(self):
     """Render instance to configuration string in Modular Crypt Format."""
     return render_mc2(self.ident, self.salt, self.checksum)
Exemple #7
0
 def format_hash(cls, _salt, _checksum):
     return render_mc2(cls.ident, b64encode(_salt).decode('utf-8'), _checksum)
Exemple #8
0
 def format_hash(cls, _checksum):
     return render_mc2(cls.ident, cls._generate_salt(), _checksum)
Exemple #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)