[REBOL] Re: subtracting binaries
From: maarten:vrijheid at: 3-Apr-2004 9:32
Hi Gregg ,
I tested it some more, and it works like a charm! Thanks for the
time-saver. Especially the fact that it works modulo (max value of the
supplied binary) is really nice.
And getting it back to a binary is simple:
>> a: add-bitsets mb checksum/secure mold now mb checksum/secure mold
now/precise
== make bitset! #{A2B6BECF9C1DC2F6C8F35FAD01DD46BF6545EDB4}
>> make binary! a
== #{
A2B6BECF9C1DC2F6C8F35FAD01DD46BF6545EDB4000000000000000000000000
}
>> copy/part make binary! a 20
== #{A2B6BECF9C1DC2F6C8F35FAD01DD46BF6545EDB4}
BTW: I never really "got" bitsets (shame) so if anybody wants to
elaborate on how the various operation on bitsets work... The docs don't
mention the bitset! value at all, except for parse (where I used it).
Thanks!
--Maarten
Gregg Irwin wrote: