Open benelot opened 1 year ago
Interestingly, this way around it works quite well, but the height of 4 seems to cause issues, saying two matrices are equal when they are not. But this is related to the vertical symmetry property of the identicons, reducing the entropy of the identicon massively to only a few bits.
data = np.array2string(np_array)
# Instantiate a generator.
generator = Generator(4, 25, digest=hashlib.sha256)
# Call the method and get the results.
asciidenticon = generator.generate(data, 4, 25, output_format="ascii")
print(asciidenticon)
Hm... You know, I wouldn't be surprised if I never tested with non-square output size. When you say you face a problem, can you elaborate a bit?
Haha, yes I thought so. It is rather atypical to have them non-square, but I use them to compare to numpy matrices so I quickly see if they are the same, so I print the ascii version to console. If I use a non-square output size, I get a classical array index out of bounds error.
I tried to print pydenticons for my numpy matrices, which works quite well for square input, but gets a problem with non-square identicons.
Am I using it incorrectly?