Skip to content

Force pack as binary #86

Description

@adrianroe

I'm trying to pack the following data structure.

#{<<"Coalesce">> => true,
  <<"Name">> => <<"streamAvailable">>,
  <<"Payload">> =>
      term_to_binary({streamAvailable,{streamId,<<"stream1">>},<<"172.16.169.1">>})
}.

In a perfect world I would use '{pack_str, from_binary}' but it then tries to pack Payload as a string and fails on the 'unicode:characters_to_binary' check. Is there a way to force Payload to be encoded as a binary while allowing the others to remain strings?

Thanks for the efforts on a great library!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions