Skip to content
Snippets Groups Projects
Commit dff94f05 authored by dam1n19's avatar dam1n19
Browse files

platform support

parent 6092dae2
No related branches found
No related tags found
No related merge requests found
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
import os, sys, random, math, csv import os, sys, random, math, csv
import subprocess import subprocess
from hashlib import sha256 import platform
def main(): def main():
# Check Environment Variables set # Check Environment Variables set
...@@ -82,10 +82,14 @@ def main(): ...@@ -82,10 +82,14 @@ def main():
out_data_words_list += out_data_words out_data_words_list += out_data_words
out_data_words_last_list += out_data_words_last out_data_words_last_list += out_data_words_last
intval = int(data, 2) intval = int(data, 2)
cmd = f"echo -n {data} | shasum -a 256 -0" hash_val = 0
hash_process = subprocess.Popen(cmd, stdout=subprocess.PIPE, shell=True) if (platform.system() == "Darwin"):
hash_val = (str(hash_process.communicate()[0]).split()[0][2:]) cmd = f"echo -n {data} | shasum -a 256 -0"
# hash_val = subprocess.getoutput(["echo", "-n", data ,"|", "shasum", "-a", "256", "-0"]) hash_process = subprocess.Popen(cmd, stdout=subprocess.PIPE, shell=True)
hash_val = (str(hash_process.communicate()[0]).split()[0][2:])
else:
print("Platform not supported yet")
exit()
# print(hash_val) # print(hash_val)
hash_list.append(hash_val) hash_list.append(hash_val)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment