[erlang-questions] hmac sha256 erlang

Bob Ippolito <>
Sun May 8 23:49:25 CEST 2011


binary:copy/2 is more useful for this purpose.

On Sunday, May 8, 2011, Robert Virding
<> wrote:
> In the docs for binary:copy it says:
>
> "This function will always create a new binary, even if N = 1. By using copy/1 on a binary referencing a larger binary, one might free up the larger binary for garbage collection."
>
> Although there is a caveat saying that it might be actually useful in special cases.
>
> Robert
>
> ----- "Steve Davis" <> wrote:
>
>> Maybe not but in this case it seems marginally faster and I can't see
>> any other impact?
>>
>> I'm definitely open to correction/enlightenment, but I don't see why
>> not here!
>>
>> /s
>>
>> On May 6, 4:43 pm, Robert Virding <
>> solutions.com> wrote:
>> > Why would you want to do binary:copy here? It is not what it is
>> intended for.
>> >
>> > Robert
>> >
>> > ----- "Steve Davis" <> wrote:
>> >
>> > > ...though now I would favor binary:copy instead of
>> > > list_to_binary(lists:duplicate()), but that depends on what OTP
>> > > version you have...
>> >
>> > > /s
>> > > _______________________________________________
>> > > erlang-questions mailing list
>> > > 
>> > >http://erlang.org/mailman/listinfo/erlang-questions
>> >
>> > _______________________________________________
>> > erlang-questions mailing list
>> >
>> ://erlang.org/mailman/listinfo/erlang-questions
>> _______________________________________________
>> erlang-questions mailing list
>> 
>> http://erlang.org/mailman/listinfo/erlang-questions
> _______________________________________________
> erlang-questions mailing list
> 
> http://erlang.org/mailman/listinfo/erlang-questions
>



More information about the erlang-questions mailing list