def pk_hash(self): return default_base.from_decimal(int(str(self.id), 16))
def hash(self, value): return default_base.from_decimal(int(str(value), 16))
def shortcode(value): value = ''.join([app.config.get('SECRET_KEY', ''), value]) crc32_val = abs(crc32(value)) return default_base.from_decimal(int(str(crc32_val), 16)).upper()