04-20-2025, 04:09 PM
This is for the safety guaranteed for the file integrity kingdom of Windows.
ID: QQNW492.000
Link: https://smallbasic.com/program/?QQNW492.000
Requires: LitDev 1.2.30.0 Beta or higher, Small Basic 1.2 (web download version, 1.3 is UWP and doesn't support libs)
Feel free to expand or to bundle in your own SB apps!
ID: QQNW492.000
Link: https://smallbasic.com/program/?QQNW492.000
Requires: LitDev 1.2.30.0 Beta or higher, Small Basic 1.2 (web download version, 1.3 is UWP and doesn't support libs)
Code:
main()
Sub main
TextWindow.Hide()
path = LDDialogs.InputBox("Get a MD5 hash of a file. Use 'dialog' to open a file selection dialog instead.", "Hash Retriever")
If path = "dialog" Then
getFile = LDDialogs.OpenFile("All files (*.*)|*.*", "")
retrievedHash = LDEncryption.MD5HashFile(getFile)
showHash()
Else
retrievedHash = LDEncryption.MD5HashFile(path)
showHash()
EndIf
EndSub
Sub showHash
TextWindow.Hide()
TextWindow.Title = ""
TextWindow.Show()
TextWindow.WriteLine("MD5 Hash: "+retrievedHash)
TextWindow.Write("Retrieve another hash? (Y/N) ")
getYorN = TextWindow.Read()
If getYorN = "y" Then
main()
ElseIf getYorN = "n" Then
Program.End()
EndIf
EndSub
Feel free to expand or to bundle in your own SB apps!