Created
August 17, 2023 10:12
-
-
Save nrollr/cb678d4220f5226ee57480fb18f4f3a4 to your computer and use it in GitHub Desktop.
Hash instance types
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
from hashlib import blake2b | |
json_content = json.load(open('json_file.json')) | |
items = [] | |
for item in json_content: | |
items.append(item['instance_type']) | |
for i in items: | |
instance = i | |
h = blake2b(digest_size = 8) | |
h.update(instance.encode("utf-8")) | |
instance_hash = h.hexdigest() | |
print(i + ";" + instance_hash + ";") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment