Commit Graph

144 Commits

Author SHA1 Message Date
Christian Reitter 3204e18fa3 Add required dependencies, formatting 2025-06-29 19:25:24 +02:00
Steven Roose 5bb47117ba
Merge pull request #88 from rust-bitcoin/release-2.2.0
Release v2.2.0
2025-06-16 00:27:17 +01:00
Steven Roose e9785082bd
Release v2.2.0 2025-06-15 19:33:10 +01:00
Steven Roose bc5a233b3d
Merge pull request #69 from michalkucharczyk/mku-compilation-fix-no-std
compilation fix for no-std
2025-06-12 12:37:33 +01:00
Steven Roose 2b7c63dac7
Merge pull request #71 from tcharding/04-08-document-hashes-msrv
Document MSRV effect of different versions of hashes
2025-06-12 12:28:42 +01:00
Steven Roose a56c99ba67
Merge branch 'master' into 04-08-document-hashes-msrv 2025-06-12 12:28:32 +01:00
Steven Roose 082adcfb58
Merge pull request #86 from elsirion/2025-06-no-pin
Make MSRV test green again
2025-06-12 12:26:47 +01:00
elsirion 7d1c0cf8f5
chore: add Cargo-minimal.lock
The minimal lock file can be used to run tests with a known-good
set of dependency versions.
2025-06-10 15:24:58 +02:00
elsirion fddecd95e9
fix: MSRV test
The MSRV test on master was failing for a while. Since MSRV is
the reason to keep unicode-normalization pinned I fixed it to
demonstrate that even without pinning downstream consumers can
maintain the current MSRV.
2025-06-04 13:10:39 +02:00
Michal Kucharczyk 8653fb2775
compilation fix for no-std
Co-authored-by: Tobin C. Harding <me@tobin.cc>
2024-04-08 08:30:16 +02:00
Tobin C. Harding a363ec6e87
Document MSRV effect of different versions of hashes
We use a range dependency for `bitcoin_hashes`, the different allowed
versions each have a different MSRV, which implies using each changes
the MSRV of `bip39`.
2024-04-08 09:28:10 +10:00
Steven Roose b100bf3e22
Merge pull request #54 from rust-bitcoin/release-2.1.0
Release 2.1.0
2024-04-03 15:31:56 +01:00
Steven Roose 125abebde6
Release v2.1.0 2024-04-02 12:23:26 +01:00
Steven Roose 8df746dcdd
Add Language::ALL and deprecated Language::all() 2024-04-02 12:23:24 +01:00
Steven Roose 627aa963df
Merge pull request #67 from michalkucharczyk/mku-compilation-fix
compilation fix
2024-04-02 12:09:24 +01:00
Michal Kucharczyk 6ce654b21f
compilation fix
fixing:
error: the item `ToString` is imported redundantly
  --> src/lib.rs:48:26
error: the item `Vec` is imported redundantly
  --> src/lib.rs:48:44

error: could not compile `bip39` (lib) due to 2 previous errors
2024-03-28 21:30:16 +01:00
Steven Roose a4c57cb84c
Merge pull request #64 from michalkucharczyk/mku-use-reexports-fix
Use rand crate re-exports when available
2024-03-28 19:18:43 +00:00
Steven Roose 6f6ec34f2d
Merge pull request #57 from michalkucharczyk/mku-unicode-normalization-in-no-std
`alloc` feature added, to gate unicode normalization
2024-03-28 19:15:52 +00:00
Michal Kucharczyk 33c3d131ef
Use rand crate re-exports when available
Re-exports from `rand` crate shall be used. Otherwise trait bounds in
`Mnemonic::generate_in_with` for `rand::thread_rng` object can get
unsatisfied if crate deps get ouf of sync.

This commit is fixing following errors:
```
error[E0277]: the trait bound `ThreadRng: rand_core::RngCore` is not satisfied
   --> /home/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bip39-2.0.0/src/lib.rs:292:30
    |
292 |         Mnemonic::generate_in_with(&mut rand::thread_rng(), language, word_count)
    |         -------------------------- ^^^^^^^^^^^^^^^^^^^^^^^ the trait `rand_core::RngCore` is not implemented for `ThreadRng`
    |         |
    |         required by a bound introduced by this call
    |::
    = help: the following other types implement trait `rand_core::RngCore`:
...
note: required by a bound in `Mnemonic::generate_in_with`
   --> /home/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bip39-2.0.0/src/lib.rs:266:6
    |
260 |     pub fn generate_in_with<R>(
    |            ---------------- required by a bound in this associated function
...
266 |         R: rand_core::RngCore + rand_core::CryptoRng,
    |            ^^^^^^^^^^^^^^^^^^ required by this bound in `Mnemonic::generate_in_with`

```

```
error[E0277]: the trait bound `ThreadRng: rand_core::CryptoRng` is not satisfied
   --> /home/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bip39-2.0.0/src/lib.rs:292:30
    |
292 |         Mnemonic::generate_in_with(&mut rand::thread_rng(), language, word_count)
    |         -------------------------- ^^^^^^^^^^^^^^^^^^^^^^^ the trait `rand_core::CryptoRng` is not implemented for `ThreadRng`
    |         |
    |         required by a bound introduced by this call
    |
    = help: the following other types implement trait `rand_core::CryptoRng`:
...
note: required by a bound in `Mnemonic::generate_in_with`
   --> /home/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bip39-2.0.0/src/lib.rs:266:27
    |
260 |     pub fn generate_in_with<R>(
    |            ---------------- required by a bound in this associated function
...
266 |         R: rand_core::RngCore + rand_core::CryptoRng,
    |                                 ^^^^^^^^^^^^^^^^^^^^ required by this bound in `Mnemonic::generate_in_with`

```

Co-authored-by: Tobin C. Harding <me@tobin.cc>
2024-02-10 12:16:03 +01:00
Michal Kucharczyk 86353a5dc8
`alloc` feature added enabling unicode_normalization in no-std
This commit introduces the `alloc` feature.

The alloc feature is intended to use in no-std environments which are allowed to
use alloc. New feature enables:
- the unicode-normalization, and all related methods (parse_in,normalize_utf8_cow,parse,to_seed)
- to_entropy() method as Vec is available in alloc,
2024-02-10 12:07:55 +01:00
Michal Kucharczyk 09d89c5048
formatting 2024-02-10 12:07:51 +01:00
Steven Roose a84eb0012e
Merge pull request #66 from rust-bitcoin/fix-msrv
Fix MSRV build and tests
2024-02-10 01:41:50 +07:00
Steven Roose 28991bd150
readme: Inform user bitcoin_hashes needs to be pinned for MSRV 2024-02-09 18:32:38 +00:00
Steven Roose 5dcdac9c74
Fix MSRV build and tests 2024-02-09 18:30:16 +00:00
Steven Roose 7f554391ae
Change hashes dep spec to >=0.12,<0.14 2024-01-29 18:42:19 +00:00
Steven Roose 37915dc0ae
Merge pull request #60 from kayabaNerve/master
bitcoin_hashes >= 0.12, <= 0.13
2024-01-30 01:41:52 +07:00
Steven Roose b11619d72a
Merge pull request #62 from pezcore/feature/checksum
Add interface to expose the mnemonic checksum
2024-01-30 01:37:21 +07:00
Steven Roose 54358b9feb
Run uni tests for each individual language 2024-01-29 18:33:43 +00:00
Steven Roose 8bf5b20629
Add unit test to check ordering of supposedly ordered word lists 2024-01-29 18:33:42 +00:00
Steven Roose d8b046da28
Replace unreachable_patterns tag with explicit feature use 2024-01-29 18:33:40 +00:00
pezcore 51fd048e86
feat: optimize impl of Language::find_word
For languages that support it, the implementation of
`Language::find_word` now uses binary search to find the word index. For
languages that do not support it, the old linear search is used.

This substantially improves the runtime performance of
`Language::find_word`. For affected languages, average lookup rate is
increased ~25x on release builds and ~100x on debug builds.
2024-01-29 18:33:39 +00:00
Marko Bencun c02046c031
fix some important std unit tests that were not running due to typo
`#[cfg(features = "std")]` is invalid and always disabled the whole block.
2024-01-29 18:16:49 +00:00
pezcore 778527cd4f feat: add checksum interface for Mnemonic 2024-01-25 21:11:07 -05:00
Luke Parker 256a00e7c2
bitcoin_hashes >= 0.12, <= 0.13 2023-11-27 23:07:42 -05:00
Steven Roose a7649ae740
Merge pull request #50 from Foundation-Devices/jeandudey/iter
Iterator improvements
2023-10-19 09:53:55 -04:00
Steven Roose 405b290fbd
Merge pull request #53 from flemosr/add-portuguese-support
Add Portuguese language support
2023-10-19 09:29:45 -04:00
Rafael Lemos e0102ba431
Update `README` 2023-10-13 16:27:33 -03:00
Rafael Lemos 75d4f0c559
Add Portuguese language support 2023-10-13 15:05:49 -03:00
Rafael Lemos b2f49fd2b2
Update `Cargo.toml`
Enable the "rand" feature by default in the dev-dependencies, in order to run
the benches.
2023-10-13 14:25:15 -03:00
Jean-Pierre De Jesus DIAZ 0b92d8db6c
Add iterator over word indices.
Signed-off-by: Jean-Pierre De Jesus DIAZ <me@jeandudey.tech>
2023-09-20 13:09:22 +02:00
Jean-Pierre De Jesus DIAZ 73f0c112aa
Add words and deprecate word_iter method
To follow the convention for Rust iterators, for example, in `str`
the method for a char iterator is `chars` not `char_iter`.

Signed-off-by: Jean-Pierre De Jesus DIAZ <me@jeandudey.tech>
2023-09-20 13:05:20 +02:00
Steven Roose aa6609ac2b
Merge pull request #49 from Foundation-Devices/jeandudey/editorconfig
Fix .editorconfig indent style
2023-08-27 20:36:14 -05:00
Steven Roose d93a017ec3
Merge pull request #51 from Foundation-Devices/jeandudey/docs
Fix typo and remove extern crate in documentation
2023-08-27 20:31:14 -05:00
Steven Roose d6681c0871
Merge pull request #52 from pezcore/doc/feature-gated-items
Enable documentation of feature-gated items in docsrs
2023-08-27 20:30:48 -05:00
pezcore 53090ea50d doc: fix reference to Vec<u8> 2023-03-24 13:26:27 -04:00
pezcore 36fc016a16 Make reference to source BIP a hyperlink 2023-03-24 13:26:10 -04:00
pezcore c7ae12fb64 doc: enable documentation of feature-gated items in docsrs 2023-03-24 13:22:53 -04:00
Jean-Pierre De Jesus DIAZ 795574e73b
Remove extern crate from examples documentation
Signed-off-by: Jean-Pierre De Jesus DIAZ <me@jeandudey.tech>
2023-03-13 12:13:01 +01:00
Jean-Pierre De Jesus DIAZ a0bb29c05e
Fix typo in variable documentation
Signed-off-by: Jean-Pierre De Jesus DIAZ <me@jeandudey.tech>
2023-03-13 12:12:39 +01:00
Jean-Pierre De Jesus DIAZ f429e9b68e
Fix .editorconfig indent style
Signed-off-by: Jean-Pierre De Jesus DIAZ <me@jeandudey.tech>
2023-03-13 11:46:34 +01:00