.
This commit is contained in:
+13
-3
@@ -466,10 +466,20 @@ class RapidImage(models.Model):
|
||||
#pre_join = ",".join(flatten)
|
||||
#print(pre_join)
|
||||
#hash = hashlib.md5(pre_join.encode()).hexdigest()
|
||||
#----
|
||||
#md5 = hashlib.md5()
|
||||
#for i in dataset.pixel_array.flatten():
|
||||
# md5.update(f"{str(i)},".encode())
|
||||
#print(0)
|
||||
|
||||
#hash = md5.hexdigest()
|
||||
#----
|
||||
md5 = hashlib.md5()
|
||||
for i in dataset.pixel_array.flatten():
|
||||
md5.update(f"{str(i)},".encode())
|
||||
print(0)
|
||||
flat_array = list(dataset.pixel_array.astype(str).flatten())
|
||||
last_el = flat_array.pop()
|
||||
for i in flat_array:
|
||||
md5.update(f"{i},".encode())
|
||||
md5.update(last_el.encode())
|
||||
|
||||
hash = md5.hexdigest()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user