[erlang-questions] number->bytes and bytes->number

Christian S chsu79@REDACTED
Wed May 16 22:31:30 CEST 2007


The maximum unsigned integer you can store in 160 bits (20 bytes) is 2^160-1.

Try this in the shell:

N = 2 bsl 160 - 1.
<<N:160>>.

On 5/16/07, Gary Jefferson <garyjefferson123@REDACTED> wrote:
> How do I convert a number like "2 bsl 160" to a list
> of bytes (20 bytes in this case) and vice versa?
>
> thanks,
> Gary
>
>
>
> ____________________________________________________________________________________Looking for a deal? Find great prices on flights and hotels with Yahoo! FareChase.
> http://farechase.yahoo.com/
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://www.erlang.org/mailman/listinfo/erlang-questions
>



More information about the erlang-questions mailing list