* int to hex * Websocket frame size * Hash methods refactor * Uri components fix
21 lines
549 B
Plaintext
21 lines
549 B
Plaintext
function GetSha256(input as string) as string
|
|
return GetEvpDigest(input, "sha256")
|
|
end function
|
|
|
|
function GetSha1(input as string) as string
|
|
return GetEvpDigest(input, "sha1")
|
|
end function
|
|
|
|
function GetMd5(input as string) as string
|
|
return GetEvpDigest(input, "md5")
|
|
end function
|
|
|
|
function GetEvpDigest(input as string, method as string) as string
|
|
buffer = CreateObject("roByteArray")
|
|
buffer.FromAsciiString(input)
|
|
|
|
digest = CreateObject("roEVPDigest")
|
|
digest.Setup(method)
|
|
return digest.Process(buffer)
|
|
end function
|