def get(self, request, algorithm, text=""): hash_obj = GetHash(algorithm) return JsonResponse(hash_obj.gethash(text))
def post(self, request, algorithm, text=""): data = json.loads(request.body) text = data.get('text', "") hash_obj = GetHash(algorithm) return JsonResponse(hash_obj.gethash(text))