Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- open System.Security.Cryptography
- open System.Security.Principal
- open System.Text
- open System
- // 1st arg (index [0]) is this script
- let name = fsi.CommandLineArgs.[1]
- let hash = new SHA1CryptoServiceProvider()
- let tail = name.ToUpper()
- |> Encoding.Unicode.GetBytes
- |> (fun x -> hash.ComputeHash(x))
- let head = [|1uy; 6uy; 0uy; 0uy; 0uy; 0uy; 0uy; 5uy; 80uy; 0uy; 0uy; 0uy |]
- let binary = Array.append head tail
- let sid = new SecurityIdentifier(binary, 0)
- Console.WriteLine(sid.ToString())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement