{NeoBook Function}
Version=5.60
Language=VBScript
Comment=SHA-1 File|TG @kagamine_len_gay
Param=[%1]|FileName|File:
Param=[%2]|Variable|Variable to store SHA-1:
{End}

Set stream = CreateObject("ADODB.Stream")
stream.Type = 1
stream.Open
stream.LoadFromFile "[%1]"

Set sha = CreateObject("System.Security.Cryptography.SHA1CryptoServiceProvider")

hash = sha.ComputeHash_2(stream.Read)

stream.Close

result = ""

For i = 1 To LenB(hash)
    result = result & LCase(Right("0" & Hex(AscB(MidB(hash, i, 1))), 2))
Next

publication.nbSetVar "[%2]", result

Set sha = Nothing
Set stream = Nothing