def sha256(text) open("tmp.file", "wb") do |f| f.write text end system 'powershell -c "(Get-FileHash -Path tmp.file).Hash" > out.txt' File.read("out.txt").chomp("\n") end print sha256 "123" exit