lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Hello Luiz,
thanks for the help. Your code is most surely correct.
But this
http://codepad.org/JJcm3J5b
(which should reproduce the sha1-rsa library using bc)  is not working
(the decrypted message is not the one I'm expecting to see).

Maybe I cannot use your url2bc to convert any hexadecimal value to
bc's big-int, can i ?

Also, assuming  it works, I'm not sure how a reversible operation
(bc2url) is possible.


On Wed, Mar 17, 2010 at 1:45 PM, Luiz Henrique de Figueiredo
<lhf@tecgraf.puc-rio.br> wrote:
>> Those hex values represent urls as returned by :
>
> Try this:
>
> require"bc"
>
> function url2bc(url)
>        local x=bc.number(0)
>        for i=1,#url do
>                x=16*x+url:byte(i)
>        end
>        return x
> end
>
> print(url2bc("http://www.lua.org/";))
>