Skip to content

Commit 0aea1ae

Browse files
committed
update features and blake lib version
1 parent 51040df commit 0aea1ae

File tree

6 files changed

+33
-24
lines changed

6 files changed

+33
-24
lines changed

CHANGELOG.md

+13-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,23 @@
11
# Changelog
22

3-
## v0.3.0
3+
## v0.4.0
44

55
- Enhancements
66

77
- updated blake package version
8-
- added support for keyed hashes with `new_keyed`, `keyed_hash`, and `derive_key`
8+
- `c` flag deprecated as it is now on be default
9+
- `c_neon` additional alias `neon` to match feature name in rust lib
10+
11+
## v0.3.0
912

13+
- Enhancements
14+
15+
- updated blake package version
16+
- added support to reset hasher with `reset`
17+
- blake3 rust features can be enabled by env var or mix config (need to recompile the library)
18+
- multi-threading is now enabled via setting the `rayon` feature
19+
- when multi-threading is enable `update_with_join` is used to to parallelize
20+
- SIMD features enabled be set with `simd_mode`
1021

1122
## v0.2.0
1223

README.md

+4-5
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ The package can be installed by adding `blake3` to your list of dependencies in
1212
```elixir
1313
def deps do
1414
[
15-
{:blake3, "~> 0.3.0"}
15+
{:blake3, "~> 0.4.0"}
1616
]
1717
end
1818
```
@@ -24,20 +24,19 @@ run `mix deps.get` and `mix deps.compile` to pull and build the bindings
2424
There are feature options in the rust implementation that allow for additional SIMD instructions and multithreading. They can be set though environment variable or `Mix.Config`.
2525

2626
```shell
27-
export BLAKE3_SIMD_MODE=c
27+
export BLAKE3_SIMD_MODE=neon
2828
export BLAKE3_RAYON=true
2929
```
3030

3131
or
3232

3333
```elixir
3434
config :blake3,
35-
simd_mode: :c_neon,
35+
simd_mode: :neon,
3636
rayon: :true
3737
```
3838

39-
* `c` enables C/assembly implementations and AVX-512 support
40-
* `c_neon` enables ARM NEON support
39+
* `neon` enables ARM NEON support
4140
* `rayon` enables Rayon-based multithreading
4241

4342
When changing configuration you will need to call `mix deps.compile` to enable the features.

mix.exs

+5-5
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ defmodule MixBlake3.Project do
44
def project do
55
[
66
app: :blake3,
7-
version: "0.3.0",
7+
version: "0.4.0",
88
elixir: "~> 1.8",
99
build_embedded: Mix.env() == :prod,
1010
start_permanent: Mix.env() == :prod,
@@ -71,10 +71,10 @@ defmodule MixBlake3.Project do
7171
defp config_features() do
7272
simd =
7373
case Application.get_env(:blake3, :simd_mode) || System.get_env("BLAKE3_SIMD_MODE") do
74-
"c" -> "c"
75-
:c -> "c"
76-
"c_neon" -> "c_neon"
77-
:c_neon -> "c_neon"
74+
"c_neon" -> "neon"
75+
:c_neon -> "neon"
76+
"neon" -> "neon"
77+
:neon -> "neon"
7878
_ -> "std"
7979
end
8080

native/blake3/Cargo.lock

+4-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

native/blake3/Cargo.toml

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
[package]
22
name = "blake3"
3-
version = "0.2.1"
3+
version = "0.3.3"
44
authors = ["Thomas Jean <thomas.jean486@gmail.com>"]
55

66
[features]
77

88
default = ["blake3/default"]
9-
c = ["blake3/c"]
10-
c_neon = ["blake3/c_neon"]
9+
neon = ["blake3/neon"]
1110
std = ["blake3/std"]
1211
rayon = ["blake3/rayon"]
1312

@@ -21,4 +20,4 @@ crate_type = ["cdylib"]
2120
rustler = ">=0.20.0"
2221
rustler_codegen = ">=0.20.0"
2322
bincode = ">=1.2.0"
24-
blake3 = ">=0.2.1"
23+
blake3 = ">=0.3.3"

test/blake3_test.exs

+4-4
Original file line numberDiff line numberDiff line change
@@ -103,12 +103,12 @@ defmodule Blake3Test do
103103
hash1 = Blake3.hash("data")
104104

105105
hash2 =
106-
Blake3.new
106+
Blake3.new()
107107
|> Blake3.update("a string that won't affect the results because reset will be called")
108-
|> Blake3.reset
108+
|> Blake3.reset()
109109
|> Blake3.update("data")
110-
|> Blake3.finalize
111-
110+
|> Blake3.finalize()
111+
112112
assert hash1 == hash2
113113
end
114114

0 commit comments

Comments
 (0)