Add hexa id generator

This commit is contained in:
ismailsosic
2022-05-09 09:51:31 +02:00
parent 5e3964381c
commit 8c59061da5
11 changed files with 46 additions and 3 deletions

View File

@@ -0,0 +1,12 @@
from rest_framework.decorators import api_view
from rest_framework.response import Response
import secrets
# Create your views here.
@api_view(['GET'])
def HexaGenerator(request):
if request.method == 'GET':
hexa_id = secrets.token_hex(16)
return Response({"message": "Search id:", "data": hexa_id})