Skip to content

Commit

Permalink
fix: use :erlang.bxor/2 instead of Bitwise.bxor/2 (#18)
Browse files Browse the repository at this point in the history
* use :erlang.bxor/2 instead of Bitwise.bxor/2

* add change notes to changelog
  • Loading branch information
the-mikedavis authored Jul 2, 2021
1 parent 9e758d6 commit a321154
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@ The format is based on [Keep a
Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to
[Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## 0.1.2 - 2021-07-02

### Fixed

- Switch from using `Bitwise.bxor/2` to `:erlang.bxor/2` for compatibility
with Elixir < 1.10

## 0.1.1 - 2021-07-01

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion lib/mint/web_socket/frame.ex
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ defmodule Mint.WebSocket.Frame do
apply_mask(
payload_rest,
mask,
<<acc::binary, Bitwise.bxor(mask_key, part_key)::integer-size(8)-unit(unquote(n))>>
<<acc::binary, :erlang.bxor(mask_key, part_key)::integer-size(8)-unit(unquote(n))>>
)
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/mint/web_socket/per_message_deflate.ex
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ defmodule Mint.WebSocket.PerMessageDeflate do

frame =
Frame.unquote(opcode)(frame,
reserved: <<Bitwise.bxor(reserved, 0b100)::size(3)>>,
reserved: <<:erlang.bxor(reserved, 0b100)::size(3)>>,
data: data
)

Expand Down

0 comments on commit a321154

Please sign in to comment.