This repository was archived by the owner on Dec 17, 2025. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 190
Feature: add digestType 'base64-safe' #259
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alexander-akait
approved these changes
Jun 4, 2024
| - `[<hashType>:contenthash:<digestType>:<length>]` optionally one can configure | ||
| - other `hashType`s, i. e. `xxhash64`, `sha1`, `md4` (wasm version), `native-md4` (`crypto` module version), `md5`, `sha256`, `sha512` | ||
| - other `digestType`s, i. e. `hex`, `base26`, `base32`, `base36`, `base49`, `base52`, `base58`, `base62`, `base64` | ||
| - other `digestType`s, i. e. `hex`, `base26`, `base32`, `base36`, `base49`, `base52`, `base58`, `base62`, `base64`, `base64safe` |
Member
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I changed it to base64safe (without -), because regexp in interpolateName can be used in many place and I don't want to change it
| return hash.digest(digestType || "hex").substr(0, maxLength); | ||
| return encodeBufferToBase( | ||
| hash.digest(), | ||
| digestType === "base64safe" ? 64 : digestType.substr(4), |
Member
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's also use a table to achieve higher entropy, removing characters can create conflicts, i.e. 3ZWmHo0=hPMWE2rZeN_oHB6 and 3ZWmHo0hPMWE2rZe=N_oHB6 will be same after removing characters, this is bad
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR contains a:
Motivation / Use-Case
To simplify migration from v2 and getting "clean" css classnames,
digestTypewithbase64-safedon't contain/,+and=symbols.Breaking Changes
No