[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Difference between a+b and bit32.band(a+b)
- From: waspoza <waspoza@...>
- Date: Sat, 10 Sep 2011 11:44:39 +0200
On Sat, Sep 10, 2011 at 2:33 AM, Petite Abeille
<petite.abeille@gmail.com> wrote:
>> while true do
>> b = file:read(2^12)
>> if not b then break end
>> x:add(b)
>> end
>>
>> Its uglier, but gives correct checksums.
>
> If you prefer the for loop try something along these lines:
>
> for b in function() return file:read( 2^12 ) end do
> x:add( b )
> end
Thats look nice, thanks! :)
BTW, if anyone here can modify lua-users wiki pages, maybe its good
idea to fix this page: http://lua-users.org/wiki/SecureHashAlgorithm
and replace io.lines with read.
- References:
- Difference between a+b and bit32.band(a+b), waspoza
- Re: Difference between a+b and bit32.band(a+b), Duncan Cross
- Re: Difference between a+b and bit32.band(a+b), Luiz Henrique de Figueiredo
- Re: Difference between a+b and bit32.band(a+b), waspoza
- Re: Difference between a+b and bit32.band(a+b), Lee Hickey
- Re: Difference between a+b and bit32.band(a+b), waspoza
- Re: Difference between a+b and bit32.band(a+b), Duncan Cross
- Re: Difference between a+b and bit32.band(a+b), waspoza
- Re: Difference between a+b and bit32.band(a+b), waspoza
- Re: Difference between a+b and bit32.band(a+b), Petite Abeille