Skip to content

Commit

Permalink
Update base64 to latest version
Browse files Browse the repository at this point in the history
As I said elsewhere: not a fan of the API changes. But here the code is
easy to adjust and it's good to stay with the latest version to avoid
dependencies trees having different versions of the same crates.
  • Loading branch information
LukasKalbertodt committed Apr 17, 2023
1 parent 05a78cc commit d4fb159
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Expand Up @@ -26,7 +26,7 @@ compress = ["flate2", "reinda-macros/compress"]

[dependencies]
ahash = "0.8.3"
base64 = { version = "0.13", optional = true }
base64 = { version = "0.21.0", optional = true }
bytes = "1"
flate2 = { version = "1", optional = true }
reinda-core = { version = "=0.0.2", path = "core" }
Expand Down
4 changes: 2 additions & 2 deletions src/hash.rs
@@ -1,5 +1,6 @@
use bytes::Bytes;
use reinda_core::AssetDef;
use base64::Engine;


#[cfg(not(feature = "hash"))]
Expand Down Expand Up @@ -36,9 +37,8 @@ pub(crate) fn hashed_path_of(def: &AssetDef, content: &Bytes) -> String {

// Calc and then base64 encode the hash.
let hash = Sha256::digest(&content);
base64::encode_config_buf(
base64::engine::general_purpose::URL_SAFE_NO_PAD.encode_string(
&hash.as_slice()[..HASH_BYTES_IN_FILENAME],
base64::URL_SAFE_NO_PAD,
&mut out,
);

Expand Down

0 comments on commit d4fb159

Please sign in to comment.