FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Converter HASH SHA-1 C# fivewin
Posts: 139
Joined: Fri Nov 25, 2005 04:38 PM
Converter HASH SHA-1 C# fivewin
Posted: Tue May 31, 2011 08:35 PM
I need convert code to fivewin

public void setTexto(String texto)
{
this.texto = texto;
SHA1 sha = new SHA1CryptoServiceProvider();
byte[] data = System.Text.Encoding.ASCII.GetBytes(texto);
byte[] hash = sha.ComputeHash(data);

StringBuilder sb = new StringBuilder();
for (int i = 0; i < hash.Length; i++)
{
sb.Append(hash[i].ToString("x2"));
}

textoAssinado = sb.ToString();
}
Ronaldo Minacapelli
Sistemas, Hospedagem e Criação de WebSites
http://www.bazevani.com.br
Posts: 990
Joined: Wed Oct 19, 2005 02:17 PM
Re: Converter HASH SHA-1 C# fivewin
Posted: Wed Jun 01, 2011 07:45 AM

Hi Ronaldo,

if you use Harbour, you can use these functions:

HB_MD5
HB_SHA1
HB_SHA224
HB_SHA256
HB_SHA384
HB_SHA512

Best regards,

Felix

Posts: 139
Joined: Fri Nov 25, 2005 04:38 PM
Re: Converter HASH SHA-1 C# fivewin
Posted: Wed Jun 01, 2011 12:36 PM

Hi Felix,

i´m use xHabrour, this possible the use in xHarbour

Ronaldo Minacapelli
Sistemas, Hospedagem e Criação de WebSites
http://www.bazevani.com.br
Posts: 990
Joined: Wed Oct 19, 2005 02:17 PM
Re: Converter HASH SHA-1 C# fivewin
Posted: Wed Jun 01, 2011 01:06 PM

Ronaldo,

I don't know if these functions are in xHarbour. Sorry. You must ask in xHarbour forums.

Best regards,

Felix

Continue the discussion