mirror of
				https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nopaque.git
				synced 2025-11-04 04:12:45 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			11 lines
		
	
	
		
			270 B
		
	
	
	
		
			Python
		
	
	
	
	
	
			
		
		
	
	
			11 lines
		
	
	
		
			270 B
		
	
	
	
		
			Python
		
	
	
	
	
	
from app import hashids
 | 
						|
from werkzeug.routing import BaseConverter
 | 
						|
 | 
						|
 | 
						|
class HashidConverter(BaseConverter):
 | 
						|
    def to_python(self, value: str) -> int:
 | 
						|
        return hashids.decode(value)[0]
 | 
						|
 | 
						|
    def to_url(self, value: int) -> str:
 | 
						|
        return hashids.encode(value)
 |