zahar0401

ReactOS Key Generator

Jul 30th, 2016
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.60 KB | None | 0 0
  1. local hArgs = {...}
  2.  
  3. local function usage()
  4.  printError("hasher <string> [file to output]")
  5. end
  6.  
  7. if not SHA1 then
  8.  if not os.loadAPI("/api/SHA1") then
  9.   error("could not load hashing algorithm (SHA1)")
  10.  end
  11. end
  12.  
  13. if #hArgs < 1 then
  14.  usage()
  15. else
  16.  local texta = SHA1.digestStr(hArgs[1])
  17.  print("Address: "..texta[1])
  18.  local textb = textutils.serialize(SHA1.digestStr(hArgs[1]))
  19.  print("SHA1 serialized bytehash: "..textb)
  20.  if #hArgs == 2 then
  21.   print("Outputting hash to "..hArgs[2])
  22.   local file = fs.open(hArgs[2], "w")
  23.   file.writeLine(texta)
  24.   file.writeLine(textb)
  25.   file.close()
  26.  end
  27. end
Advertisement
Add Comment
Please, Sign In to add comment