Skip to content

Instantly share code, notes, and snippets.

@nrollr
Created August 17, 2023 10:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nrollr/cb678d4220f5226ee57480fb18f4f3a4 to your computer and use it in GitHub Desktop.
Save nrollr/cb678d4220f5226ee57480fb18f4f3a4 to your computer and use it in GitHub Desktop.
Hash instance types
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