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