commit_hash
stringlengths
40
40
author
stringlengths
1
57
date
timestamp[s]date
2010-07-26 04:45:09
2026-04-14 18:21:10
message
stringlengths
8
1.39M
diff
stringlengths
68
51.2k
files_changed
int64
1
136
insertions
int64
0
2.35k
deletions
int64
0
1.9k
9d70ee40621393f851c9d78242c7da2911614263
koushiro
2019-08-30T06:13:38
Support no_std Signed-off-by: koushiro <koushiro.cqx@gmail.com>
diff --git a/Cargo.toml b/Cargo.toml index cf24ef0..9559541 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,7 +10,8 @@ license = "MIT/Apache-2.0" edition = "2018" [features] -default = [] +default = ["std"] +std = [] check = ["sha2"] [dependencies] diff --git a/src/decode.rs b/src/decode.rs index bcaac70..73e85...
4
21
2
97910e6847ca8d2dfde536fb91c4ec9d295bbc59
koushiro
2019-08-30T06:13:38
Move all tests to the tests dir Signed-off-by: koushiro <koushiro.cqx@gmail.com>
diff --git a/src/decode.rs b/src/decode.rs index 0718941..d5a8a49 100644 --- a/src/decode.rs +++ b/src/decode.rs @@ -363,59 +363,3 @@ impl fmt::Display for Error { } } } -// Subset of test cases from https://github.com/cryptocoinjs/base-x/blob/master/test/fixtures.json -#[cfg(test)] -mod tests { - use...
6
105
124
0de5173dce4ac07d060c907b978495a5f3767b55
Wim Looman
2019-08-30T16:16:36
Remove deprecated functionality
diff --git a/src/decode.rs b/src/decode.rs index 073f85c..0718941 100644 --- a/src/decode.rs +++ b/src/decode.rs @@ -17,10 +17,6 @@ pub struct DecodeBuilder<'a, I: AsRef<[u8]>> { expected_ver: Option<u8> } -/// Errors that could occur when decoding a Base58 encoded string. -#[deprecated(since = "0.2.5", note = ...
3
0
92
d4d0a7e7055933d3c28e70d2e76f7cfedfebc1a0
Wim Looman
2019-08-30T16:12:54
Pre-version-bump for breaking changes
diff --git a/Cargo.toml b/Cargo.toml index 095d1e4..5a0dc8f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "bs58" -version = "0.2.5" +version = "0.3.0" authors = ["Wim Looman <wim@nemo157.com>"] description = "Another Base58 codec implementation."
1
1
1
39ae2475350df36e184f09d1f12c664da9f65f80
Wim Looman
2019-08-30T15:52:09
Bump version to 0.2.5
diff --git a/Cargo.toml b/Cargo.toml index 4e36a2e..095d1e4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "bs58" -version = "0.2.4" +version = "0.2.5" authors = ["Wim Looman <wim@nemo157.com>"] description = "Another Base58 codec implementation."
1
1
1
758722279599f0f3f5d514db22d9bc0e2f45f2b3
Wim Looman
2019-08-21T19:32:27
Rename bs58::decode::DecodeError to remove stutter
diff --git a/src/decode.rs b/src/decode.rs index 3780cc0..073f85c 100644 --- a/src/decode.rs +++ b/src/decode.rs @@ -1,6 +1,9 @@ //! Functions for decoding Base58 encoded strings. -pub use error::DecodeError; +use std::fmt; + +#[cfg(feature = "check")] +use CHECKSUM_LEN; /// A builder for setting up the alphabet ...
4
135
134
a0590aaaf34f684c06450a3c6411c58291d8c340
Wim Looman
2019-08-19T20:41:21
Bump version to 0.2.4
diff --git a/Cargo.toml b/Cargo.toml index 9c538d2..4e36a2e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "bs58" -version = "0.2.3" +version = "0.2.4" authors = ["Wim Looman <wim@nemo157.com>"] description = "Another Base58 codec implementation."
1
1
1
c0eec9941ce795dee69d5230c8e82ea8e02970cd
Wim Looman
2019-08-19T20:24:35
Allocate output as the same size as input
diff --git a/src/decode.rs b/src/decode.rs index a9b467d..3780cc0 100644 --- a/src/decode.rs +++ b/src/decode.rs @@ -86,7 +86,7 @@ impl<'a, I: AsRef<[u8]>> DecodeBuilder<'a, I> { /// ``` /// pub fn into_vec(self) -> Result<Vec<u8>, DecodeError> { - let mut output = vec![0; std::cmp::max(self.input...
1
1
1
3385f9ab7b69df37b3a34af97995ac45f5298134
Illia Polosukhin
2019-05-27T23:00:01
Fix #25: can't decode 32 bytes of 0s
diff --git a/src/decode.rs b/src/decode.rs index a2d6bac..a9b467d 100644 --- a/src/decode.rs +++ b/src/decode.rs @@ -86,7 +86,7 @@ impl<'a, I: AsRef<[u8]>> DecodeBuilder<'a, I> { /// ``` /// pub fn into_vec(self) -> Result<Vec<u8>, DecodeError> { - let mut output = vec![0; (self.input.as_ref().len...
2
2
1
00511d575ed9b1ad9b52bc360a809c42a72ea3d8
Wim Looman
2019-04-28T10:07:26
Bump version to v0.2.3
diff --git a/Cargo.toml b/Cargo.toml index c7ba3c7..9c538d2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "bs58" -version = "0.2.2" +version = "0.2.3" authors = ["Wim Looman <wim@nemo157.com>"] description = "Another Base58 codec implementation."
1
1
1
aaacdc2fe07fd12b095e4c55447879a59ab0ee50
kpcyrd
2019-04-27T19:51:04
Bump sha2 dependency
diff --git a/Cargo.toml b/Cargo.toml index a30dc43..c7ba3c7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -18,7 +18,7 @@ default = [] check = ["sha2"] [dependencies] -sha2 = { version = "0.7.1", optional = true } +sha2 = { version = "0.8.0", optional = true } [dev_dependencies] base58 = "0.1.0"
1
1
1
2e8bedc652c8919def4748af4882ab1184f5a17c
Wim Looman
2018-09-15T09:00:14
Bump version
diff --git a/Cargo.toml b/Cargo.toml index af00d94..a30dc43 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "bs58" -version = "0.2.1" +version = "0.2.2" authors = ["Wim Looman <wim@nemo157.com>"] description = "Another Base58 codec implementation."
1
1
1
f8e11345b2dacb53d0b926238fc95ea4f9486f94
Wim Looman
2018-09-10T17:41:30
Add docs on feature flags
diff --git a/src/decode.rs b/src/decode.rs index 2bf1312..a2d6bac 100644 --- a/src/decode.rs +++ b/src/decode.rs @@ -44,13 +44,17 @@ impl<'a, I: AsRef<[u8]>> DecodeBuilder<'a, I> { } } - /// Expect and check checksum when decoding. Uses Base58Check as described on - /// [bitcoin wiki][] + /// E...
3
33
8
eb10272538a3102eeb29349756c89667b0cf72cd
Wim Looman
2018-09-08T12:06:00
Fix doc links
diff --git a/src/lib.rs b/src/lib.rs index cb6552b..0a05d26 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -81,6 +81,7 @@ const CHECKSUM_LEN: usize = 4; pub use traits::{ FromBase58, ToBase58 }; /// Setup decoder for the given string using the [default alphabet][]. +/// /// [default alphabet]: alphabet/constant.DEFAU...
1
2
0
52d0936b831b8f807766c9f78bcdecc30beaa2bd
Wim Looman
2018-09-08T09:28:20
Don't expose check fns without feature
diff --git a/src/decode.rs b/src/decode.rs index f1bc672..2bf1312 100644 --- a/src/decode.rs +++ b/src/decode.rs @@ -82,15 +82,11 @@ impl<'a, I: AsRef<[u8]>> DecodeBuilder<'a, I> { /// ``` /// pub fn into_vec(self) -> Result<Vec<u8>, DecodeError> { - let input = self.input.as_ref(); - let m...
2
31
40
1b8346f336a06559e474431809db70e83fcd669b
Wim Looman
2018-09-08T09:11:24
Make check error variants feature dependent
diff --git a/src/error.rs b/src/error.rs index 8d4688b..ebf4a7f 100644 --- a/src/error.rs +++ b/src/error.rs @@ -1,5 +1,7 @@ use std::error::Error; use std::fmt; + +#[cfg(feature = "check")] use CHECKSUM_LEN; /// Errors that could occur when decoding a Base58 encoded string. @@ -25,6 +27,7 @@ pub enum DecodeError...
1
11
0
252dd048150cf2479530aed8df51cfc0bf9afe09
Wim Looman
2018-09-08T09:11:08
Mark error enum as non-exhaustive
diff --git a/src/error.rs b/src/error.rs index 564e7a3..8d4688b 100644 --- a/src/error.rs +++ b/src/error.rs @@ -42,7 +42,10 @@ pub enum DecodeError { }, ///Not enough bytes to have both a checksum and a payload (less than to CHECKSUM_LEN) - NoChecksum + NoChecksum, + + #[doc(hidden)] + __NonExh...
1
6
1
4a66dc3789ed68951a50f9d01366a04343b60670
Devin Fisher
2018-09-07T16:23:07
remove un-needed print statement Signed-off-by: Devin Fisher <devin.fisher@evernym.com>
diff --git a/src/decode.rs b/src/decode.rs index 5343db4..a30efd5 100644 --- a/src/decode.rs +++ b/src/decode.rs @@ -150,7 +150,6 @@ pub fn decode_into(input: &[u8], output: &mut [u8], alpha: &[u8; 58]) -> Result< }; for (i, c) in input.iter().enumerate() { - println!("i:{} -- c:{}", i, c); ...
1
0
1
74d12fd249969419f23ad5d1586baeec728293c8
Devin Fisher
2018-09-07T16:20:15
add test for InvalidCharacter in decode Signed-off-by: Devin Fisher <devin.fisher@evernym.com>
diff --git a/src/decode.rs b/src/decode.rs index ce3b43f..5343db4 100644 --- a/src/decode.rs +++ b/src/decode.rs @@ -150,6 +150,7 @@ pub fn decode_into(input: &[u8], output: &mut [u8], alpha: &[u8; 58]) -> Result< }; for (i, c) in input.iter().enumerate() { + println!("i:{} -- c:{}", i, c); ...
1
20
0
7bdd58d2359fa37a284dc18cbb3c27cf57279a43
Devin Fisher
2018-09-06T22:24:46
remove SliceChain, a simpler way was suggested
diff --git a/src/encode.rs b/src/encode.rs index 2cd3f07..3c507f8 100644 --- a/src/encode.rs +++ b/src/encode.rs @@ -122,7 +122,7 @@ pub fn encode_into(input: &[u8], output: &mut String, alpha: &[u8; 58]){ } fn _encode_into<'a, I>(input: I, output: &mut String, alpha: &[u8; 58]) - where I: Copy + IntoIterator<It...
1
7
42
e7ca8c2ffbcd9cf0cc4a1124f62015f6c3f892d0
Devin Fisher
2018-09-06T22:01:14
changes for PR review
diff --git a/Cargo.toml b/Cargo.toml index 1513778..af00d94 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -23,3 +23,4 @@ sha2 = { version = "0.7.1", optional = true } [dev_dependencies] base58 = "0.1.0" rust-base58 = "0.0.4" +assert_matches = "1.3.0" diff --git a/src/decode.rs b/src/decode.rs index 949c9ef..ce3b43f 10...
4
37
21
e7c304e668809bb3e7a11b2de743320f5d951561
Devin Fisher
2018-09-06T21:26:37
fix clippy warnings
diff --git a/src/decode.rs b/src/decode.rs index 399236b..949c9ef 100644 --- a/src/decode.rs +++ b/src/decode.rs @@ -81,9 +81,12 @@ impl<'a, I: AsRef<[u8]>> DecodeBuilder<'a, I> { pub fn into_vec(self) -> Result<Vec<u8>, DecodeError> { let input = self.input.as_ref(); let mut output = vec![0; (in...
2
27
14
1003a3c0b5abe95438e7525ec2802a6bdce89fa5
Devin Fisher
2018-09-06T21:01:30
removed newer rust syntax Signed-off-by: Devin Fisher <devin.fisher@evernym.com>
diff --git a/src/decode.rs b/src/decode.rs index 67c5515..399236b 100644 --- a/src/decode.rs +++ b/src/decode.rs @@ -38,7 +38,7 @@ impl<'a, I: AsRef<[u8]>> DecodeBuilder<'a, I> { DecodeBuilder { input: self.input, - alpha, + alpha: alpha, check: self.che...
2
2
2
0df9f04a06c1b658bdeefbe6f48dd921bb949850
Devin Fisher
2018-09-06T20:42:01
change namespace conflict and fixed bug with with_address with respect check
diff --git a/src/decode.rs b/src/decode.rs index 75a9f74..67c5515 100644 --- a/src/decode.rs +++ b/src/decode.rs @@ -10,7 +10,7 @@ pub use error::DecodeError; pub struct DecodeBuilder<'a, I: AsRef<[u8]>> { input: I, alpha: &'a [u8; 58], - with_check: bool, + check: bool, expected_ver: Option<u8> ...
2
13
13
cfae51332059278aabbdf7523bc9de98b2919e26
Devin Fisher
2018-09-06T20:25:30
remove un-needed println
diff --git a/src/decode.rs b/src/decode.rs index cb5ab63..75a9f74 100644 --- a/src/decode.rs +++ b/src/decode.rs @@ -195,7 +195,6 @@ pub fn decode_into(input: &[u8], output: &mut [u8], alpha: &[u8; 58]) -> Result< /// ```rust /// let input = "PWEu9GGN"; /// let mut output = [0; 6]; -/// println!("{:?}", output); //...
1
0
1
d766d8d480a16c401595e23a345de41a132f5ffb
Devin Fisher
2018-09-06T20:12:24
add doc and a cleaner encode function sig
diff --git a/src/decode.rs b/src/decode.rs index 292a943..cb5ab63 100644 --- a/src/decode.rs +++ b/src/decode.rs @@ -44,15 +44,25 @@ impl<'a, I: AsRef<[u8]>> DecodeBuilder<'a, I> { } } + /// Expect and check checksum when decoding. + /// + /// Option parameter for version byte. If provided, the...
3
117
35
ce07e797969d190c5ce9c640d021288070f19ed6
Devin Fisher
2018-09-06T00:02:08
Add feature flag for check Signed-off-by: Devin Fisher <devin.fisher@evernym.com>
diff --git a/Cargo.toml b/Cargo.toml index 3317cbd..1513778 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -12,8 +12,13 @@ keywords = ["base58"] license = "MIT/Apache-2.0" +[features] +default = [] + +check = ["sha2"] + [dependencies] -sha2 = "0.7.1" +sha2 = { version = "0.7.1", optional = true } [dev_dependencie...
4
22
5
9a10fd04ecc7cdc6498cc40157bc3d5a2eb269a3
Devin Fisher
2018-09-05T22:47:15
fix compiler warnings
diff --git a/src/decode.rs b/src/decode.rs index e70ed98..04a4100 100644 --- a/src/decode.rs +++ b/src/decode.rs @@ -211,7 +211,7 @@ pub fn decode_check_into(input: &[u8], output: &mut [u8], alpha: &[u8; 58], expe } #[cfg(not(test))] -pub fn decode_check_into(input: &[u8], output: &mut [u8], alpha: &[u8; 58], expec...
2
2
4
f06e6e3d19f7ed316bc72bc165dd084adda1c8ad
Wim Looman
2018-07-12T18:24:04
Bump version
diff --git a/Cargo.toml b/Cargo.toml index b1fa2b0..6ab1b57 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "bs58" -version = "0.2.0" +version = "0.2.1" authors = ["Wim Looman <wim@nemo157.com>"] description = "Another Base58 codec implementation."
1
1
1
635aa16628f7bb3ed84b4f68dad72a507f5bbdc2
Wim Looman
2018-07-12T18:00:52
Check that alphabet contains only valid ASCII characters This adds a slight constant cost to all encoding, measuring on my machine it seems to be around ~20-30ns, which when compared to ~2000ns for encoding 32 bytes seems fine. Fixes #8.
diff --git a/src/encode.rs b/src/encode.rs index cd9ab7e..90af73d 100644 --- a/src/encode.rs +++ b/src/encode.rs @@ -81,8 +81,19 @@ impl<'a, I: AsRef<[u8]>> EncodeBuilder<'a, I> { /// assert_eq!("he11owor1d", output) /// ``` pub fn encode_into(input: &[u8], output: &mut String, alpha: &[u8; 58]) { + assert!(alpha...
1
12
1
986acb07018dc8e271f54d1d7b803c7eb8845818
Wim Looman
2018-06-27T15:21:43
Fix 1.27 warnings Including fix for #9
diff --git a/src/decode.rs b/src/decode.rs index 4d29b03..c8863a9 100644 --- a/src/decode.rs +++ b/src/decode.rs @@ -95,7 +95,7 @@ impl<'a, I: AsRef<[u8]>> DecodeBuilder<'a, I> { /// bs58::decode::decode_into(input.as_ref(), &mut output, bs58::alphabet::DEFAULT); /// assert_eq!([0x04, 0x30, 0x5e, 0x2b, 0x24, 0x73, 0x...
3
4
4
4689eb906224df595055e987142dff3bfa4c09ab
Wim Looman
2017-01-07T13:21:09
Add named lifetimes for with_alphabet to improve docs
diff --git a/src/decode.rs b/src/decode.rs index e64d42d..4d29b03 100644 --- a/src/decode.rs +++ b/src/decode.rs @@ -31,7 +31,8 @@ impl<'a, I: AsRef<[u8]>> DecodeBuilder<'a, I> { /// .with_alphabet(bs58::alphabet::RIPPLE) /// .into_vec().unwrap()); /// ``` - pub fn with_alphabet(self, ...
2
4
2
a02d5e85131291b4286f5cd917a7e214f0a58a55
Wim Looman
2017-01-07T13:19:19
Add todo prefix for todo
diff --git a/src/lib.rs b/src/lib.rs index fcc1f47..d2ec0e9 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -69,7 +69,7 @@ pub mod encode; mod error; mod traits; -#[allow(useless_attribute)] // See clippy issue #1372 +#[allow(useless_attribute)] // TODO: See clippy issue #1372 #[allow(deprecated)] pub use traits::{ F...
1
1
1
b9841b6957a753561358dabddaea763885da3e40
Wim Looman
2017-01-07T13:19:07
Add examples to crate level docs
diff --git a/src/lib.rs b/src/lib.rs index 17c9621..fcc1f47 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -28,6 +28,39 @@ //! [Base58]: https://en.wikipedia.org/wiki/Base58 //! [`base58`]: https://github.com/debris/base58 //! [`rust-base58`]: https://github.com/nham/rust-base58 +//! +//! # Examples +//! +//! ## Basic ...
1
33
0
f98beaf7345f6b6ce935e06c22c3a2bc0303010d
Wim Looman
2017-01-07T13:18:48
Add docs about the encoder reallocating
diff --git a/src/encode.rs b/src/encode.rs index f1f79b6..9d763f0 100644 --- a/src/encode.rs +++ b/src/encode.rs @@ -48,6 +48,9 @@ impl<'a, I: AsRef<[u8]>> EncodeBuilder<'a, I> { /// Encode into the given string, any existing data will be cleared. /// + /// If the given string does not have enough capaci...
1
3
0
f0112b4f342ef01fd60a2260b0199b81572a66bf
Wim Looman
2017-01-07T13:18:31
Add links out to the decode documentation from the builder
diff --git a/src/decode.rs b/src/decode.rs index 51a1e0b..e64d42d 100644 --- a/src/decode.rs +++ b/src/decode.rs @@ -3,6 +3,9 @@ pub use error::DecodeError; /// A builder for setting up the alphabet and output of a base58 decode. +/// +/// See the documentation for [`bs58::decode`](../fn.decode.html) for a more +//...
1
10
0
e558cc74fe07fea26711bf68850eb165004c59c4
Wim Looman
2017-01-07T13:01:21
Hide the docs for the deprecated traits
diff --git a/src/traits.rs b/src/traits.rs index 0317f4d..08dd2fc 100644 --- a/src/traits.rs +++ b/src/traits.rs @@ -7,6 +7,7 @@ use error::DecodeError; since = "0.2.0", note = "Use `bs58::encode` and associated functions instead" )] +#[doc(hidden)] pub trait ToBase58 { /// Base58 encode `self` to an o...
1
2
0
8dbfb791c76faf8b474e0bab76cdc01c5f82dbc1
Wim Looman
2016-12-04T22:46:46
Version 0.2.0
diff --git a/Cargo.toml b/Cargo.toml index 0119f68..b1fa2b0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "bs58" -version = "0.1.3" +version = "0.2.0" authors = ["Wim Looman <wim@nemo157.com>"] description = "Another Base58 codec implementation."
1
1
1
1c47a9b4d30d294e9eb9605399b7c288fe0ea732
Wim Looman
2016-12-04T22:45:49
Hide details inside modules for better docs
diff --git a/src/decode.rs b/src/decode.rs index 7588bfe..51a1e0b 100644 --- a/src/decode.rs +++ b/src/decode.rs @@ -1,4 +1,6 @@ -use { alphabet, DecodeError }; +//! Functions for decoding Base58 encoded strings. + +pub use error::DecodeError; /// A builder for setting up the alphabet and output of a base58 decode. ...
4
126
113
b9e1583786428c07a0537c26dd9f4d09daa1da42
Wim Looman
2016-12-04T22:32:56
Remove type alias since there's a major version bump
diff --git a/src/lib.rs b/src/lib.rs index 324c138..4194da4 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -42,7 +42,7 @@ pub use encode::{ encode, encode_into, EncodeBuilder }; #[allow(useless_attribute)] // See clippy issue #1372 #[allow(deprecated)] -pub use traits::{ FromBase58, ToBase58, FromBase58Error }; +pub u...
2
7
11
872b3ea01730e11cd0d5fb65726d436fb0eb47c7
Wim Looman
2016-12-04T22:31:38
Going to need a major bump for new error variant
diff --git a/src/traits.rs b/src/traits.rs index 19c32a6..32f7d8c 100644 --- a/src/traits.rs +++ b/src/traits.rs @@ -1,13 +1,13 @@ use { encode, decode, DecodeError }; /// Errors that could occur when decoding a Base58 encoded string. -#[deprecated(since = "0.1.4")] +#[deprecated(since = "0.2.0")] pub type FromBas...
1
3
3
b2efbd1dfaf412dcd69395a425248ba194380bce
Wim Looman
2016-12-04T22:30:57
Add specific error type for non-ascii characters
diff --git a/src/decode.rs b/src/decode.rs index b0450cb..7588bfe 100644 --- a/src/decode.rs +++ b/src/decode.rs @@ -101,6 +101,14 @@ impl<'a, I: AsRef<[u8]>> DecodeBuilder<'a, I> { /// bs58::decode("hello world").into_vec().unwrap_err()); /// ``` /// +/// ### Non-ASCII Character +/// +/// ```rust +/// assert_eq...
2
32
7
18983f5c40a66fc888f298fd133c834af9b35e2f
Wim Looman
2016-12-04T22:23:15
Add decode examples
diff --git a/src/decode.rs b/src/decode.rs index d5b6721..b0450cb 100644 --- a/src/decode.rs +++ b/src/decode.rs @@ -9,11 +9,30 @@ pub struct DecodeBuilder<'a, I: AsRef<[u8]>> { impl<'a, I: AsRef<[u8]>> DecodeBuilder<'a, I> { /// Change the alphabet that will be used for decoding. + /// + /// # Examples +...
1
99
3
0907cd725a92a0d9b3d9a40814307cfb34471b7a
Wim Looman
2016-12-04T22:03:20
Add encode examples
diff --git a/src/encode.rs b/src/encode.rs index 443cc25..791ce74 100644 --- a/src/encode.rs +++ b/src/encode.rs @@ -9,11 +9,29 @@ pub struct EncodeBuilder<'a, I: AsRef<[u8]>> { impl<'a, I: AsRef<[u8]>> EncodeBuilder<'a, I> { /// Change the alphabet that will be used for encoding. + /// + /// # Examples +...
1
69
0
9724e6fd6887e81c1a79396b165add61f8eea451
Wim Looman
2016-12-04T21:40:55
Update upsides of this vs. other implementations
diff --git a/src/lib.rs b/src/lib.rs index 05ebf83..324c138 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -15,12 +15,15 @@ //! //! Compared to [`base58`][] this is significantly faster at decoding (about //! 2.4x as fast when decoding 32 bytes), almost the same speed for encoding -//! (about 3% slower when encoding 32...
1
6
3
5113d2850501b024aace33667fa32854f1df7dae
Wim Looman
2016-12-04T21:37:04
Make fact index is a byte explicit
diff --git a/src/error.rs b/src/error.rs index 674716f..d76afbc 100644 --- a/src/error.rs +++ b/src/error.rs @@ -11,7 +11,7 @@ pub enum DecodeError { InvalidCharacter { /// The unexpected character. character: char, - /// The index in the input string the character was at. + /// The...
1
2
2
0db12020b5a58d536856a48c542b9421b88988a7
Wim Looman
2016-12-03T14:26:03
More benches
diff --git a/benches/bench.rs b/benches/bench.rs index 286e877..05c81bf 100644 --- a/benches/bench.rs +++ b/benches/bench.rs @@ -59,6 +59,15 @@ macro_rules! case { bench_to!(base58, $decoded); bench_to!(bs58, $decoded); bench_to!(rust_base58, $decoded); + ...
1
9
0
6f07c2258b39b5b53ef0d1634a10bf2d1d9b1a1a
Wim Looman
2016-12-03T13:34:55
Encode builder
diff --git a/examples/encode.rs b/examples/encode.rs index dc4b8c1..2d28353 100644 --- a/examples/encode.rs +++ b/examples/encode.rs @@ -5,5 +5,5 @@ use std::io::{ self, Read }; fn main() { let mut input = Vec::<u8>::new(); io::stdin().read_to_end(&mut input).unwrap(); - println!("{}", bs58::encode(input)...
4
49
26
7d1c78e2e19617de1466f84290d9e3e5f3deb5c2
Wim Looman
2016-12-03T12:57:45
Only provide implementation over slices instead of monomorphizing it
diff --git a/src/decode.rs b/src/decode.rs index e66fb90..d5b6721 100644 --- a/src/decode.rs +++ b/src/decode.rs @@ -15,14 +15,16 @@ impl<'a, I: AsRef<[u8]>> DecodeBuilder<'a, I> { /// Decode into a new vector of bytes. pub fn into_vec(self) -> Result<Vec<u8>, DecodeError> { - let mut output = vec![0...
1
7
7
0178356cad1b5a59af9675a3aa2f35f980edb1b8
Wim Looman
2016-12-01T19:50:50
Deprecate traits and add builder as replacement
diff --git a/benches/bench.rs b/benches/bench.rs index 3ab9cce..286e877 100644 --- a/benches/bench.rs +++ b/benches/bench.rs @@ -8,6 +8,7 @@ extern crate rust_base58; macro_rules! bench_from { ($krate:ident, $value:expr) => { #[bench] + #[allow(deprecated)] fn $krate(b: &mut ::test::Bench...
8
306
147
850d3ad96837f27762c5e9b94aba903bb6d0c56c
Wim Looman
2017-01-07T12:34:13
Fix clippy warning
diff --git a/benches/bench.rs b/benches/bench.rs index b77246e..3ab9cce 100644 --- a/benches/bench.rs +++ b/benches/bench.rs @@ -11,7 +11,7 @@ macro_rules! bench_from { fn $krate(b: &mut ::test::Bencher) { use $krate::FromBase58; let temp = $value; - if let Err(_) = temp.fr...
1
1
1
bfa837ce54f6fd42c80e22d7862ebf9e98594431
Wim Looman
2016-11-05T10:21:27
Bump version
diff --git a/Cargo.toml b/Cargo.toml index 4a075e0..0119f68 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "bs58" -version = "0.1.2" +version = "0.1.3" authors = ["Wim Looman <wim@nemo157.com>"] description = "Another Base58 codec implementation."
1
1
1
ce56f3d90bb9ee5f6b6d0770b016567835b6938f
Wim Looman
2016-11-05T10:21:05
Update repository url
diff --git a/Cargo.toml b/Cargo.toml index 2af7f50..4a075e0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -5,7 +5,7 @@ authors = ["Wim Looman <wim@nemo157.com>"] description = "Another Base58 codec implementation." -repository = "https://github.com/Nemo157/bs58-rs" +repository = "https://github.com/mycorrhiza/bs58-r...
1
1
1
fb6ed0de07fef8b71ecf6edb23b31b621478c723
Wim Looman
2016-11-02T21:06:23
Specify explicit versions
diff --git a/Cargo.toml b/Cargo.toml index 179aebd..2af7f50 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "bs58" -version = "0.1.1" +version = "0.1.2" authors = ["Wim Looman <wim@nemo157.com>"] description = "Another Base58 codec implementation." @@ -13,5 +13,5 @@ keywords = ["base58"]...
1
3
3
d207b56605e05e55cbaa16a4866e88a4eddc6c0b
Wim Looman
2016-11-02T21:00:15
Missing metadata for publishing
diff --git a/Cargo.toml b/Cargo.toml index 7cdd3f2..179aebd 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,9 +1,16 @@ [package] name = "bs58" -version = "0.1.0" +version = "0.1.1" authors = ["Wim Looman <wim@nemo157.com>"] -[dependencies] +description = "Another Base58 codec implementation." + +repository = "https...
1
9
2
0417ce1f546cd5609c77372d089052c846aada95
Wim Looman
2016-11-02T20:53:26
Use a character for error reporting
diff --git a/src/decode.rs b/src/decode.rs index 20031fa..c252b61 100644 --- a/src/decode.rs +++ b/src/decode.rs @@ -21,7 +21,7 @@ pub enum FromBase58Error { /// alphabet. InvalidCharacter { /// The unexpected character. - character: u8, + character: char, /// The index in the ...
1
3
3
27e201edf92f2af3ae656b5c67ca837305007469
Wim Looman
2016-11-02T20:52:18
Add example command line tools
diff --git a/examples/decode.rs b/examples/decode.rs new file mode 100644 index 0000000..8c0bc2b --- /dev/null +++ b/examples/decode.rs @@ -0,0 +1,13 @@ +extern crate bs58; + +use std::io::{ self, Read, Write }; +use bs58::FromBase58; + +fn main() { + let mut input = String::new(); + io::stdin().read_to_string(&m...
2
23
0
bcc10a30bde015bf6ac821996978858302d63a97
Wim Looman
2016-11-02T20:29:08
Fix clippy's nits
diff --git a/src/alphabet.rs b/src/alphabet.rs index b2c3d45..875ea40 100644 --- a/src/alphabet.rs +++ b/src/alphabet.rs @@ -1,5 +1,6 @@ //! Commonly used Base58 alphabets. +#[allow(doc_markdown)] // clippy is a little over-aggressive here /// Bitcoin's alphabet as defined in their Base58Check encoding. /// /// S...
4
7
4
a02fbb2057b70824723f2aa9743ca20d9b187b3e
Wim Looman
2016-11-02T20:23:30
Add actual error type
diff --git a/src/decode.rs b/src/decode.rs index 46c8ee9..87269ac 100644 --- a/src/decode.rs +++ b/src/decode.rs @@ -1,3 +1,6 @@ +use std::error::Error; +use std::fmt; + use alphabet; /// A trait for decoding Base58 encoded values to a vector of bytes. @@ -5,18 +8,31 @@ pub trait FromBase58 { /// Decode `self`...
2
43
7
b751da314413a279762660d1f3532d9b38e561e2
Wim Looman
2016-11-02T20:04:56
Add common alphabets
diff --git a/src/alphabet.rs b/src/alphabet.rs new file mode 100644 index 0000000..b2c3d45 --- /dev/null +++ b/src/alphabet.rs @@ -0,0 +1,29 @@ +//! Commonly used Base58 alphabets. + +/// Bitcoin's alphabet as defined in their Base58Check encoding. +/// +/// See https://en.bitcoin.it/wiki/Base58Check_encoding#Base58_sy...
4
42
7
b0f8c8875a0e8eb4a03e9cd49265ce252b16ac7d
Wim Looman
2016-11-02T19:38:12
Replace 37 byte bench with 32 bytes as it's probably more common
diff --git a/benches/bench.rs b/benches/bench.rs index c4f62dc..506facc 100644 --- a/benches/bench.rs +++ b/benches/bench.rs @@ -63,13 +63,12 @@ case! { f_10_bytes_max vec![0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff] => "FPBt6CHo3fovdL" } -case! { g_37_bytes +case! { g_32_bytes vec![...
1
5
6
eac6d4c3de65e417e1471a92330f31499e5e7ac9
Wim Looman
2016-11-02T19:28:14
Enable warnings and add documentation
diff --git a/src/decode.rs b/src/decode.rs index 34b5c13..771b1d5 100644 --- a/src/decode.rs +++ b/src/decode.rs @@ -1,5 +1,9 @@ +/// A trait for decoding Base58 encoded values to a vector of bytes. pub trait FromBase58 { + /// Decode `self` to a vector of bytes using the default alphabet. fn from_base58(&self...
3
34
0
3a1fbea31c059ed90e20aadf76792e662e39543e
Wim Looman
2016-11-02T19:05:27
Unify test data
diff --git a/src/decode.rs b/src/decode.rs index 8d83f0c..34b5c13 100644 --- a/src/decode.rs +++ b/src/decode.rs @@ -59,28 +59,8 @@ mod tests { #[test] fn tests() { - let tests = [ - (vec![], ""), - (vec![0x61], "2g"), - (vec![0x62, 0x62, 0x62], "a3gV"), - ...
3
24
43
9ddd41b4ee2162803aa46d0d4efe171a0f52986c
Wim Looman
2016-11-02T18:56:18
Calculate reverse alphabet Allows using non-sorted alphabets. Slower for smaller inputs, faster for bigger ones, breakeven ~5 bytes
diff --git a/src/decode.rs b/src/decode.rs index ef1a6bd..8d83f0c 100644 --- a/src/decode.rs +++ b/src/decode.rs @@ -9,10 +9,23 @@ impl FromBase58 for str { } fn from_base58_with_alphabet(&self, alpha: &[u8; 58]) -> Result<Vec<u8>, String> { + let zero = alpha[0]; + + let alpha = { + ...
1
15
10
5bef89fa4832827c38e33046f4589fd3ede1d55b
Wim Looman
2016-11-02T18:22:48
Allow changing the alphabet
diff --git a/src/decode.rs b/src/decode.rs index d625014..ef1a6bd 100644 --- a/src/decode.rs +++ b/src/decode.rs @@ -1,17 +1,18 @@ -const ALPHA: &'static [u8] - = b"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"; - pub trait FromBase58 { fn from_base58(&self) -> Result<Vec<u8>, String>; + f...
3
23
11
30ff95653a85f5b207c3b2e108636f261584e9f9
Wim Looman
2016-11-02T17:44:42
Add benchmarks against other implementations
diff --git a/Cargo.toml b/Cargo.toml index 0d3d972..e57f2b6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,10 @@ [package] -name = "base58" +name = "rbase58" version = "0.1.0" authors = ["Wim Looman <wim@nemo157.com>"] [dependencies] + +[dev_dependencies] +base58 = "*" +rust-base58 = "*" diff --git a/benches...
2
110
1
92fda283145360432825004a720c95ce65d598cd
Wim Looman
2016-07-01T19:42:25
Remove prefix for now
diff --git a/Cargo.toml b/Cargo.toml index 456b6f2..0d3d972 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "supra-base58" +name = "base58" version = "0.1.0" authors = ["Wim Looman <wim@nemo157.com>"]
1
1
1
8293fab19ffdbbdb6b0e9c5f96a3bfa9e04c3dcd
Wim Looman
2016-06-19T10:57:43
Add encoding
diff --git a/src/decode.rs b/src/decode.rs index 7c1c5eb..d625014 100644 --- a/src/decode.rs +++ b/src/decode.rs @@ -1,6 +1,5 @@ -const ALPHA_ZERO: char = '1'; -const ALPHA: &'static str - = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"; +const ALPHA: &'static [u8] + = b"123456789ABCDEFGHJK...
3
86
10
24f5daa5257e00e87007c936761600e034827905
Allan Zhang
2026-02-12T12:56:22
lint: fix clippy `get_first` This fixes [get_first](https://rust-lang.github.io/rust-clippy/master/index.html#get_first). PR #205
diff --git a/src/arch/all/rabinkarp.rs b/src/arch/all/rabinkarp.rs index e0bafba..ce14795 100644 --- a/src/arch/all/rabinkarp.rs +++ b/src/arch/all/rabinkarp.rs @@ -86,7 +86,7 @@ impl Finder { #[inline] pub fn new(needle: &[u8]) -> Finder { let mut s = Finder { hash: Hash::new(), hash_2pow: 1 }; - ...
2
3
3
17083550e1a0ea5d5fefdb836937af9018d4bc22
Allan Zhang
2026-02-12T12:52:56
lint: fix clippy `question_mark` This fixes [question_mark](https://rust-lang.github.io/rust-clippy/master/index.html#question_mark). PR #202
diff --git a/src/memmem/mod.rs b/src/memmem/mod.rs index 03e2d9c..4d7aafc 100644 --- a/src/memmem/mod.rs +++ b/src/memmem/mod.rs @@ -351,10 +351,7 @@ impl<'h, 'n> Iterator for FindRevIter<'h, 'n> { type Item = usize; fn next(&mut self) -> Option<usize> { - let pos = match self.pos { - None...
1
1
4
5b86d0c17135eea04828277746e770ebe61201ba
Allan Zhang
2026-02-12T12:52:19
lint: fix clippy `clone_on_copy` This fixes [clone_on_copy](https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy). PR #201
diff --git a/src/memmem/searcher.rs b/src/memmem/searcher.rs index 2a533e0..73ece73 100644 --- a/src/memmem/searcher.rs +++ b/src/memmem/searcher.rs @@ -630,10 +630,8 @@ impl Prefilter { if rarest_rank > MAX_FALLBACK_RANK { None } else { - let finder = crate::arch::all::packedp...
1
2
4
7de50d0f7a762a34d49568e08327a6546fa5181f
Élie ROUDNINSKI
2026-02-06T19:38:33
memmem: add owned finder constructor variants This is useful in certain cases where you want the `Finder` to own the needle, but you don't want to pay for the extra copy and alloc. PR #182
diff --git a/src/cow.rs b/src/cow.rs index f291645..5306f97 100644 --- a/src/cow.rs +++ b/src/cow.rs @@ -43,7 +43,9 @@ impl<'a> CowBytes<'a> { /// Create a new owned CowBytes. #[cfg(feature = "alloc")] #[inline(always)] - fn new_owned(bytes: alloc::boxed::Box<[u8]>) -> CowBytes<'static> { + pub(cra...
2
45
4
9bf2301912e38b24bb25cd4db6a16023ab0da3a7
Andrew Gallant
2025-09-25T12:50:11
benchmarks: update everything
diff --git a/benchmarks/engines/libc/Cargo.lock b/benchmarks/engines/libc/Cargo.lock index 993eedb..132ae61 100644 --- a/benchmarks/engines/libc/Cargo.lock +++ b/benchmarks/engines/libc/Cargo.lock @@ -1,18 +1,18 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. -version = 3...
17
266
205
ec25b8077f7124340e0ec6398b5dd89296775744
J. Neuschäfer
2025-09-25T12:44:49
aarch64: fix NEON optimization on big-endian Due to how the NeonMoveMask is constructed, the byteswap on BE does not appear to be needed. In fact, on my aarch64_be test system, with the byteswap many tests fail, but without it, all tests pass. PR #188
diff --git a/src/arch/aarch64/neon/packedpair.rs b/src/arch/aarch64/neon/packedpair.rs index 6884882..5cc2a02 100644 --- a/src/arch/aarch64/neon/packedpair.rs +++ b/src/arch/aarch64/neon/packedpair.rs @@ -52,7 +52,7 @@ impl Finder { #[inline] pub fn with_pair(needle: &[u8], pair: Pair) -> Option<Finder> { ...
2
3
11
599d9d92aa2a1b4d6178b3b10e3a49c264caa7bf
Trevor Gross
2025-06-11T13:30:01
cargo: remove `compiler-builtins` from `rustc-dep-of-std` dependencies Since [1], this will come automatically from `rustc-std-workspace-core` and the crates.io dependency should no longer be specified. [1]: https://github.com/rust-lang/rust/pull/141993 PR #180
diff --git a/Cargo.toml b/Cargo.toml index 2ef4f24..9498972 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -52,7 +52,7 @@ libc = [] # Internal feature, only used when building as part of libstd, not part of the # stable interface of this crate. -rustc-dep-of-std = ['core', 'compiler_builtins'] +rustc-dep-of-std = ['co...
1
1
2
12d358d22f9367eb38b0b458bd901d44c853e053
Andrew Gallant
2025-03-21T19:49:14
benchmarks: update to stringzilla 3.12.3
diff --git a/benchmarks/engines/stringzilla/Cargo.lock b/benchmarks/engines/stringzilla/Cargo.lock index 85edb26..2da3ecd 100644 --- a/benchmarks/engines/stringzilla/Cargo.lock +++ b/benchmarks/engines/stringzilla/Cargo.lock @@ -1,18 +1,18 @@ # This file is automatically @generated by Cargo. # It is not intended for ...
2
24
24
8c1e043ebbfcbe6d1af770a5f68ee59b1d85e551
Andrew Gallant
2025-03-21T19:49:13
benchmarks: update memchr dependencies
diff --git a/benchmarks/engines/rust-memchr/Cargo.lock b/benchmarks/engines/rust-memchr/Cargo.lock index 8fe97dd..ac35c18 100644 --- a/benchmarks/engines/rust-memchr/Cargo.lock +++ b/benchmarks/engines/rust-memchr/Cargo.lock @@ -1,18 +1,18 @@ # This file is automatically @generated by Cargo. # It is not intended for ...
1
17
17
746182171d2e88600652de3e6768cd8aef77e585
Andrew Gallant
2024-12-31T13:25:21
lint: add docs to item because of `deny(missing_docs)` While this macro is only defined in `cfg(test)`, under that condition, it is technically exported I guess. So just add docs to it.
diff --git a/src/tests/memchr/prop.rs b/src/tests/memchr/prop.rs index b988260..949ef1f 100644 --- a/src/tests/memchr/prop.rs +++ b/src/tests/memchr/prop.rs @@ -1,9 +1,11 @@ +/// Defines a host of quickcheck tests for the given memchr searcher. #[cfg(miri)] #[macro_export] macro_rules! define_memchr_quickcheck { ...
1
2
0
a7dbafe3736b9b1499203fb9f80a8a9f6e057ae9
Tshaka Lekholoane
2024-11-13T12:57:03
doc: fix typographical errors PR #167
diff --git a/src/arch/all/memchr.rs b/src/arch/all/memchr.rs index 62fe2a3..7f327f8 100644 --- a/src/arch/all/memchr.rs +++ b/src/arch/all/memchr.rs @@ -13,7 +13,7 @@ The `One` searcher also provides a [`One::count`] routine for efficiently counting the number of times a single byte occurs in a haystack. This is usef...
5
9
9
ab237cf454c56fb73a2ba8e265b29f8eb79dd158
Andrew Gallant
2024-08-24T12:00:58
benchmarks/memchr: update dependencies
diff --git a/benchmarks/engines/rust-memchr/Cargo.lock b/benchmarks/engines/rust-memchr/Cargo.lock index 3f571a4..8fe97dd 100644 --- a/benchmarks/engines/rust-memchr/Cargo.lock +++ b/benchmarks/engines/rust-memchr/Cargo.lock @@ -10,11 +10,11 @@ checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063d...
1
16
16
060bde20a9723f14e2bd17a8357d788d7d07f08e
Andrew Gallant
2024-08-24T12:00:24
benchmarks/stringzilla: update dependencies
diff --git a/benchmarks/engines/stringzilla/Cargo.lock b/benchmarks/engines/stringzilla/Cargo.lock index 2bba1f2..85edb26 100644 --- a/benchmarks/engines/stringzilla/Cargo.lock +++ b/benchmarks/engines/stringzilla/Cargo.lock @@ -10,9 +10,9 @@ checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da"...
2
30
21
7fccf70e2a58c1fbedc9b9687c2ba0cf5992537b
Andrew Gallant
2024-06-14T00:18:45
benchmarks: bump to memchr 2.7.4 release
diff --git a/benchmarks/engines/rust-memchr/Cargo.lock b/benchmarks/engines/rust-memchr/Cargo.lock index 2a96dc8..3f571a4 100644 --- a/benchmarks/engines/rust-memchr/Cargo.lock +++ b/benchmarks/engines/rust-memchr/Cargo.lock @@ -20,10 +20,10 @@ dependencies = [ [[package]] name = "main" -version = "2.7.3" +version ...
2
4
4
b0af902c7f773c6400ef46c5c488ce89e5b58ece
Andrew Gallant
2024-06-14T00:02:49
perf: revert fallback optimization This reverts #151 because it broke big endian targets. CI didn't catch it because of a misconfiguration that resulted in tests being skipped for any target that required cross compilation. This reverts commit 345fab74bc3223ec95518686cbe6ac2b7fe7a467. Fixes #152
diff --git a/src/arch/all/memchr.rs b/src/arch/all/memchr.rs index a48b704..62fe2a3 100644 --- a/src/arch/all/memchr.rs +++ b/src/arch/all/memchr.rs @@ -141,8 +141,8 @@ impl One { // The start of the search may not be aligned to `*const usize`, // so we do an unaligned load here. let chunk = ...
1
56
291
aee9f95641495d2763d167a2e716fd0b9df7bf30
Andrew Gallant
2024-06-13T23:30:42
arch: add a second big endian regression test It turns out that the previous regression test wasn't failing for me on the `powerpc64-unknown-linux-gnu` target. But quickcheck found a case that was, so I added a second regression test specifically for that case.
diff --git a/src/arch/all/memchr.rs b/src/arch/all/memchr.rs index 74d7e56..a48b704 100644 --- a/src/arch/all/memchr.rs +++ b/src/arch/all/memchr.rs @@ -1160,6 +1160,15 @@ mod tests { assert_eq!(One::new(b':').find(b"1:23"), Some(1)); } + // Interestingly, I couldn't get `regression_big_endian1` to f...
1
9
0
92edbb6551d5cc0a014cb6d221f7f9912a4b4647
Andrew Gallant
2024-06-13T23:19:46
arch: add big endian regression test This was reported along with the fact that memchr 2.7.3 broke big endian targets. While I at first thought the test suite just somehow missed the regression and thus this test was somehow novel in some interesting way, it turned out it was just a CI configuration failure. The exist...
diff --git a/src/arch/all/memchr.rs b/src/arch/all/memchr.rs index bb99785..74d7e56 100644 --- a/src/arch/all/memchr.rs +++ b/src/arch/all/memchr.rs @@ -1143,7 +1143,24 @@ mod tests { assert_eq!(4, count); } - /// Generate 500K values. + // A test[1] that failed on some big endian targets after a ...
1
18
1
cf1373e3abeddf1e598bbe5970084750953ed2d3
Andrew Gallant
2024-06-13T23:16:45
benchmarks: bump version
diff --git a/benchmarks/engines/rust-memchr/Cargo.lock b/benchmarks/engines/rust-memchr/Cargo.lock index 4d29b55..2a96dc8 100644 --- a/benchmarks/engines/rust-memchr/Cargo.lock +++ b/benchmarks/engines/rust-memchr/Cargo.lock @@ -14,28 +14,28 @@ version = "1.9.1" source = "registry+https://github.com/rust-lang/crates.i...
2
7
7
a05cc640c1d4d720cc5d822526553ce5ebb280a7
Andrew Gallant
2024-06-13T16:12:38
lint: remove unused BITS associated constant It looks like rustc just started warning about this.
diff --git a/src/vector.rs b/src/vector.rs index d745d4c..d86fbca 100644 --- a/src/vector.rs +++ b/src/vector.rs @@ -15,8 +15,6 @@ /// to ensure they get appropriately inlined. (inline(always) cannot be used /// with target_feature.) pub(crate) trait Vector: Copy + core::fmt::Debug { - /// The number of bits in t...
1
0
6
345fab74bc3223ec95518686cbe6ac2b7fe7a467
Stepan Koltsov
2024-06-13T16:11:58
all: improve perf of memchr fallback Current generic ("all") implementation checks that a chunk (`usize`) contains a zero byte, and if it is, iterates over bytes of this chunk to find the index of zero byte. Instead, we can use more bit operations to find the index without loops. Context: we use `memchr`, but ma...
diff --git a/src/arch/all/memchr.rs b/src/arch/all/memchr.rs index 435b1be..bb99785 100644 --- a/src/arch/all/memchr.rs +++ b/src/arch/all/memchr.rs @@ -141,8 +141,8 @@ impl One { // The start of the search may not be aligned to `*const usize`, // so we do an unaligned load here. let chunk = ...
1
291
56
e8bdf6b7f7cca21bbd20dd773223a24f285bc956
Andrew Gallant
2024-06-12T17:29:08
benchmarks: bump dependencies
diff --git a/benchmarks/engines/libc/Cargo.lock b/benchmarks/engines/libc/Cargo.lock index 924bae9..993eedb 100644 --- a/benchmarks/engines/libc/Cargo.lock +++ b/benchmarks/engines/libc/Cargo.lock @@ -4,15 +4,15 @@ version = 3 [[package]] name = "anyhow" -version = "1.0.72" +version = "1.0.86" source = "registry+h...
11
459
91
21def527d55a531d161c8fedcbf3933094222aba
Andrew Gallant
2024-02-26T01:39:59
style: fix dead_code lint
diff --git a/src/ext.rs b/src/ext.rs index 1bb21dd..802697a 100644 --- a/src/ext.rs +++ b/src/ext.rs @@ -39,11 +39,13 @@ impl<T> Pointer for *mut T { } /// A trait for adding some helper routines to raw bytes. +#[cfg(test)] pub(crate) trait Byte { /// Converts this byte to a `char` if it's ASCII. Otherwise pa...
1
2
0
17753b63fd365bb6c25bbc91f819c0bb81ffaafd
Andrew Gallant
2023-12-28T22:03:15
benchmarks/engines/rust-memchr: bump to 2.7.1
diff --git a/benchmarks/engines/rust-memchr/Cargo.lock b/benchmarks/engines/rust-memchr/Cargo.lock index c0333b5..9d3efd0 100644 --- a/benchmarks/engines/rust-memchr/Cargo.lock +++ b/benchmarks/engines/rust-memchr/Cargo.lock @@ -20,10 +20,10 @@ dependencies = [ [[package]] name = "main" -version = "2.7.0" +version ...
2
4
4
d9ac66d726e1529217a9586685c609a080f38388
Andrew Gallant
2023-12-28T22:02:29
api: impl Clone for FindRevIter This should have been in 051020d76e48f948d9512a579c20f124e2dbb60c, but it was overlooked.
diff --git a/src/memmem/mod.rs b/src/memmem/mod.rs index 4d49c53..4f04943 100644 --- a/src/memmem/mod.rs +++ b/src/memmem/mod.rs @@ -310,7 +310,7 @@ impl<'h, 'n> Iterator for FindIter<'h, 'n> { /// /// `'h` is the lifetime of the haystack while `'n` is the lifetime of the /// needle. -#[derive(Debug)] +#[derive(Clon...
1
1
1
8957028d162d04bc29b5ccb22b79bbb86a239619
Andrew Gallant
2023-12-28T22:02:16
benchmarks/engines/rust-memchr: complete bump to 2.7.0
diff --git a/benchmarks/engines/rust-memchr/Cargo.lock b/benchmarks/engines/rust-memchr/Cargo.lock index 2c6a802..c0333b5 100644 --- a/benchmarks/engines/rust-memchr/Cargo.lock +++ b/benchmarks/engines/rust-memchr/Cargo.lock @@ -14,28 +14,28 @@ version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.i...
1
6
6
5caaf3e736f9b6b7bfadcfee064d2914331a33fd
Andrew Gallant
2023-12-28T21:59:13
benchmarks/engines/rust-memchr: bump to 2.7.0
diff --git a/benchmarks/engines/rust-memchr/Cargo.toml b/benchmarks/engines/rust-memchr/Cargo.toml index 9672c0b..818a25a 100644 --- a/benchmarks/engines/rust-memchr/Cargo.toml +++ b/benchmarks/engines/rust-memchr/Cargo.toml @@ -1,7 +1,7 @@ [package] publish = false name = "main" -version = "2.6.4" # should match c...
1
1
1
8b62928c7bd4e215c2c4827f7eb9dfc264eb465a
Alex Touchet
2023-12-28T21:38:22
cargo: remove unused exclusions We retain 'tmp' since I occasionally create such directories. Closes #143
diff --git a/Cargo.toml b/Cargo.toml index 4059943..a57e649 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -12,7 +12,7 @@ repository = "https://github.com/BurntSushi/memchr" readme = "README.md" keywords = ["memchr", "memmem", "substring", "find", "search"] license = "Unlicense OR MIT" -exclude = ["/bench", "/benchmark...
1
1
1
bce19408dd5c145fded8bbbb4ec8d76a937bf885
Andrew Gallant
2023-12-28T20:45:03
benchmarks/engines/bytecount: revert to 0.6.4 It looks like 0.6.7 is buggy for at least wasm32.
diff --git a/benchmarks/engines/rust-bytecount/Cargo.lock b/benchmarks/engines/rust-bytecount/Cargo.lock index 9a5a5d1..b80982f 100644 --- a/benchmarks/engines/rust-bytecount/Cargo.lock +++ b/benchmarks/engines/rust-bytecount/Cargo.lock @@ -20,13 +20,13 @@ dependencies = [ [[package]] name = "bytecount" -version = ...
2
25
5
e77f0bf07ae3445d77776aabe233a9352dd753c5
Andrew Gallant
2023-12-28T16:24:16
arch: simplify and improve is_equal_raw This came from @jhorstmann in #139[1]. It simplifies `is_equal_raw` and also in turn simplifies its codegen. Since this routine gets inlined into others, this winds up being a fair improvement: $ rebar diff -e memchr/memmem tmp/base.csv tmp/simpler-is-equal-raw.csv -t 1.1 ...
diff --git a/src/arch/all/mod.rs b/src/arch/all/mod.rs index b3d0ca2..559cb75 100644 --- a/src/arch/all/mod.rs +++ b/src/arch/all/mod.rs @@ -108,26 +108,8 @@ pub fn is_equal(x: &[u8], y: &[u8]) -> bool { pub unsafe fn is_equal_raw( mut x: *const u8, mut y: *const u8, - n: usize, + mut n: usize, ) -> b...
1
23
25
96d4e62213b79b9a973ce10e5cb6c7ab869682a0
Andrew Gallant
2023-12-28T15:31:15
benchmarks: update engine dependencies and versions
diff --git a/benchmarks/engines/libc/Cargo.toml b/benchmarks/engines/libc/Cargo.toml index c0c0cb3..7580c81 100644 --- a/benchmarks/engines/libc/Cargo.toml +++ b/benchmarks/engines/libc/Cargo.toml @@ -19,3 +19,5 @@ path = "main.rs" [profile.release] debug = true +codegen-units = 1 +lto = "fat" diff --git a/benchmar...
10
32
18
c46d73a5ac49f3c93969681ca24f377b6a08807b
Oliver-Piorun
2023-12-28T14:55:19
doc: fix typo PR #141
diff --git a/src/lib.rs b/src/lib.rs index 05b2c13..de366fb 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -146,7 +146,7 @@ will also use AVX2 accelerated routines when the `avx2` feature is enabled at compile time. In general, enable this feature if you can. * **alloc** - When enabled (the default), APIs in this crate ...
1
1
1
051020d76e48f948d9512a579c20f124e2dbb60c
Adrián Delgado
2023-12-28T14:54:47
api: impl Clone for FindIter Ref https://github.com/BurntSushi/bstr/issues/173
diff --git a/src/memmem/mod.rs b/src/memmem/mod.rs index 1a2a7e1..4d49c53 100644 --- a/src/memmem/mod.rs +++ b/src/memmem/mod.rs @@ -233,7 +233,7 @@ pub fn rfind(haystack: &[u8], needle: &[u8]) -> Option<usize> { /// /// `'h` is the lifetime of the haystack while `'n` is the lifetime of the /// needle. -#[derive(Deb...
1
1
1