<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">This may be could help (for non negative integers):<div><a href="https://github.com/extend/cowboy/blob/master/src/cowboy_http.erl#L534">https://github.com/extend/cowboy/blob/master/src/cowboy_http.erl#L534</a></div><div><br></div><div>Regards,</div><div><div><div>Zabrane</div><div><br></div></div><div><div>On Dec 31, 2011, at 3:38 PM, Muharem Hrnjadovic wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>Hello there!<br><br>Is there a way to convert a binary to an integer *directly*? Right now I<br>am using the following construct:<br><br> string:to_integer(binary_to_list(B))<br><br>where B is a binary.<br><br>Best regards/Mit freundlichen Grüßen<br><br>-- <br>Muharem Hrnjadovic <<a href="mailto:muharem@lbox.cc">muharem@lbox.cc</a>><br>Public key id : B2BBFCFC<br>Key fingerprint : A5A3 CC67 2B87 D641 103F 5602 219F 6B60 B2BB FCFC<br><br>_______________________________________________<br>erlang-questions mailing list<br><a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br>http://erlang.org/mailman/listinfo/erlang-questions<br></div></blockquote></div><br></div></body></html>