-
Notifications
You must be signed in to change notification settings - Fork 133
Permalink
Choose a base ref
{{ refName }}
default
Choose a head ref
{{ refName }}
default
Comparing changes
Choose two branches to see what’s changed or to start a new pull request.
If you need to, you can also or
learn more about diff comparisons.
Open a pull request
Create a new pull request by comparing changes across two branches. If you need to, you can also .
Learn more about diff comparisons here.
base repository: marshallpierce/rust-base64
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.22.0
Could not load branches
Nothing to show
Loading
Could not load tags
Nothing to show
{{ refName }}
default
Loading
...
head repository: marshallpierce/rust-base64
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v0.22.1
Could not load branches
Nothing to show
Loading
Could not load tags
Nothing to show
{{ refName }}
default
Loading
- 8 commits
- 5 files changed
- 3 contributors
Commits on Feb 12, 2024
-
Configuration menu - View commit details
-
Copy full SHA for e8e4a22 - Browse repository at this point
Copy the full SHA e8e4a22View commit details
Commits on Mar 18, 2024
-
Configuration menu - View commit details
-
Copy full SHA for d96c80f - Browse repository at this point
Copy the full SHA d96c80fView commit details
Commits on Mar 26, 2024
-
Merge pull request #267 from bdura/patch-1
docs: fix trailing ``` in mod.rs example
Configuration menu - View commit details
-
Copy full SHA for 9a518a2 - Browse repository at this point
Copy the full SHA 9a518a2View commit details -
Configuration menu - View commit details
-
Copy full SHA for fc6aabe - Browse repository at this point
Copy the full SHA fc6aabeView commit details -
Merge pull request #270 from marshallpierce/mp/clippy
Appease clippy
Configuration menu - View commit details
-
Copy full SHA for bf15ccf - Browse repository at this point
Copy the full SHA bf15ccfView commit details
Commits on Apr 30, 2024
-
Correct BinHex 4.0 alphabet according to specifications
# Description This pull request addresses an inconsistency between the source code and the [BinHex 4.0 specifications](https://files.stairways.com/other/binhex-40-specs-info.txt). Specifically, the variable `BIN_HEX` in [`alphabet.rs`](https://github.com/marshallpierce/rust-base64/blob/bf15ccf30af8bb6b1f326fffa025d7b0aaa3342f/src/alphabet.rs#L201C1-L206C3) and corrects it to align with the specs. # Changes ```diff pub const BIN_HEX: Alphabet = Alphabet::from_str_unchecked( - "!\"#$%&'()*+,-0123456789@ABCDEFGHIJKLMNPQRSTUVXYZ[`abcdehijklmpqr", + "!\"#$%&'()*+,-012345689@ABCDEFGHIJKLMNPQRSTUVXYZ[`abcdefhijklmpqr", ); ``` The new addition includes the character `f` and excludes the character `7`, as per the spec. # References - [BinHex 4.0 Definition](https://files.stairways.com/other/binhex-40-specs-info.txt) - [RFC 1741 - MIME Content Type for BinHex Encoded Files](https://www.rfc-editor.org/rfc/rfc1741.txt) - [MacMIME - How to send Macintosh files with MIME](https://www.iana.org/assignments/media-types/application/applefile) # Misc ```rust #[cfg(test)] mod tests { use base64::{ alphabet::{self, Alphabet, ParseAlphabetError}, engine::{self, GeneralPurposeConfig}, Engine, }; const BIN_HEX_NEW: Result<Alphabet, ParseAlphabetError> = alphabet::Alphabet::new( "!\"#$%&'()*+,-012345689@ABCDEFGHIJKLMNPQRSTUVXYZ[`abcdefhijklmpqr", ); const ENGINE_CONFIG: GeneralPurposeConfig = engine::GeneralPurposeConfig::new() .with_decode_allow_trailing_bits(true) .with_encode_padding(false) .with_decode_padding_mode(engine::DecodePaddingMode::RequireNone); const SAMPLE_INPUT: &str = "Hello, world!"; const EXPECTED_ENCODED_OUTPUT: &str = "5'9XE'mX)(G[FQaN)3"; #[test] fn src_encode() { let engine_src = engine::GeneralPurpose::new(&alphabet::BIN_HEX, ENGINE_CONFIG); let res_enc = engine_src.encode(SAMPLE_INPUT); assert_eq!(res_enc, EXPECTED_ENCODED_OUTPUT); } #[test] fn src_decode() { let engine_src = engine::GeneralPurpose::new(&alphabet::BIN_HEX, ENGINE_CONFIG); let res_dec = engine_src.decode(EXPECTED_ENCODED_OUTPUT).unwrap(); assert_eq!(res_dec, SAMPLE_INPUT.as_bytes()); } #[test] fn new_encode() { let engine_new = engine::GeneralPurpose::new(&BIN_HEX_NEW.unwrap(), ENGINE_CONFIG); let res_enc = engine_new.encode(SAMPLE_INPUT); assert_eq!(res_enc, EXPECTED_ENCODED_OUTPUT); } #[test] fn new_decode() { let engine_new = engine::GeneralPurpose::new(&BIN_HEX_NEW.unwrap(), ENGINE_CONFIG); let res_dec = engine_new.decode(EXPECTED_ENCODED_OUTPUT).unwrap(); assert_eq!(res_dec, SAMPLE_INPUT.as_bytes()); } } ``` Output ```sh running 4 tests test tests::new_encode ... ok test tests::new_decode ... ok test tests::src_decode ... FAILED test tests::src_encode ... FAILED failures: ---- tests::src_decode stdout ---- thread 'tests::src_decode' panicked at src\main.rs:34:9: assertion `left == right` failed left: [72, 101, 173, 112, 111, 45, 32, 119, 176, 118, 124, 165, 33] right: [72, 101, 108, 108, 111, 44, 32, 119, 111, 114, 108, 100, 33] note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace ---- tests::src_encode stdout ---- thread 'tests::src_encode' panicked at src\main.rs:26:9: assertion `left == right` failed left: "5'8VD'mV)(FZEP`M)3" right: "5'9XE'mX)(G[FQaN)3" failures: tests::src_decode tests::src_encode test result: FAILED. 2 passed; 2 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s ```
Configuration menu - View commit details
-
Copy full SHA for 838355e - Browse repository at this point
Copy the full SHA 838355eView commit details -
Merge pull request #271 from JobanSD/patch-1
Correct BinHex 4.0 alphabet according to specifications
Configuration menu - View commit details
-
Copy full SHA for 64cca59 - Browse repository at this point
Copy the full SHA 64cca59View commit details -
Configuration menu - View commit details
-
Copy full SHA for e144006 - Browse repository at this point
Copy the full SHA e144006View commit details
Loading
This comparison is taking too long to generate.
Unfortunately it looks like we can’t render this comparison for you right now. It might be too big, or there might be something weird with your repository.
You can try running this command locally to see the comparison on your machine:
git diff v0.22.0...v0.22.1