There is also the Encode feature that will do more what you originally wanted, but I would stick with DEREncode. You can run a BufferedTransformation through HashFilter, but that is just one way. The whole sink/source/filter concept throws people at first, but is very powerful for quickly generating code once you learn it. Spend some time looking at the documentation and examples and I think you'll get it.

        73,
                Shawn

Sarah Rastkar wrote:

So calling Integer::DEREncode(bf) will be enough? How to aply hashing on bf which is a BufferedTransformation object?

    ----- Original Message -----
    *From:* Shawn Masters <mailto:[EMAIL PROTECTED]>
    *To:* [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
    *Sent:* Thursday, 17 July, 2003 06:55 ب.ظ
    *Subject:* Re: Integer to byte*

    Well, there is a slight disconnect between Integer and an array of
    octets.  This stems from the multitude of ways they can be represented.
      If you want a byte of the n-bit Integer then you can get one (given
    normal byte boundaries) with GetByte().  You can also get the ASN.1
    encoding on an Integer, which is a stream of octets with a header
    explaining how long it is, and that it is an Integer.

    Normally a definitive format like DEREncoding to ASN.1 then hashing is
    a good way of doing this.  It eliminates ordering and other problems
    that can crop up.

    73,
    Shawn

Sarah Rastkar wrote:

> Hello!
> Is there any special function to transform an "Integer" to
"byte*" and
> vice versa? Or maybe simple casting is enough. I need these
functions to
> perform hashing on Integers.
> Wishes,
> Sarah
> >
> >






Reply via email to