Advertisement
Guest User

Untitled

a guest
May 27th, 2015
244
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. open System.Security.Cryptography
  2. open System.Security.Principal
  3. open System.Text
  4. open System
  5.  
  6. // 1st arg (index [0]) is this script
  7. let name = fsi.CommandLineArgs.[1]
  8. let hash = new SHA1CryptoServiceProvider()
  9. let tail = name.ToUpper()
  10. |> Encoding.Unicode.GetBytes
  11. |> (fun x -> hash.ComputeHash(x))
  12.  
  13. let head = [|1uy; 6uy; 0uy; 0uy; 0uy; 0uy; 0uy; 5uy; 80uy; 0uy; 0uy; 0uy |]
  14. let binary = Array.append head tail
  15.  
  16. let sid = new SecurityIdentifier(binary, 0)
  17. Console.WriteLine(sid.ToString())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement