GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Base64 hashes in filenames should be URL-safe · Issue #5136 · webpack/webpack

Base64 hashes in filenames should be URL-safe #5136

New issue
Copy link
New issue
Copy link
Closed
Closed
Base64 hashes in filenames should be URL-safe#5136
Copy link
Labels
status: staleNo author response after a needs: request; close candidate

Description

@kgram
kgram
opened on Jun 22, 2017
Issue body actions

Do you want to request a feature or report a bug?

Bug

What is the current behavior?

When using output.hashDigest = 'base64', hashes can contain / and +. Both will probably work (at least the slash will), as they will be handled the same way by webservers as filesystems. But it certainly isn't pretty when your full bundle path suddenly is /public/main.B/0sK5.js.

If the current behavior is a bug, please provide the steps to reproduce.

Because of the random nature of the issue, I don't have a simple way to reproduce it.

What is the expected behavior?

URL-safe base64 should be used. This can be achieved by replacing + with - and / with _. See https://en.wikipedia.org/wiki/Base64#URL_applications. This should probably be done everywhere base64 can be used as hash encoding.

If this is a feature request, what is motivation or use case for changing the behavior?

Please mention other relevant information such as the browser version, Node.js version, webpack version and Operating System.

Reacted by Jaid and Acid Chicken

Activity

  1. swernerx commented on Jun 22, 2017

    @swernerx
    swernerx
    on Jun 22, 2017
    Contributor
    More actions

    What about just going to base62 which is actually exactly that, file system safe. 💯

  2. kgram commented on Jun 22, 2017

    @kgram
    kgram
    on Jun 22, 2017
    Author
    More actions

    Maybe we should just get node to support arbitrary bases, then there would be no limits. I can't wait to base37 encode me som data!

  3. Kronuz commented on Oct 16, 2017

    @Kronuz
    Kronuz
    on Oct 16, 2017
    More actions

    Maybe webpack should use loaderUtils.interpolateName?

  4. webpack-bot commented on Apr 16, 2018

    @webpack-bot
    webpack-bot
    on Apr 16, 2018
    Contributor
    More actions

    This issue had no activity for at least half a year.

    It's subject to automatic issue closing if there is no activity in the next 15 days.

  5. webpack-bot
    added
    status: staleNo author response after a needs: request; close candidate
    on Apr 16, 2018
  6. webpack-bot commented on May 1, 2018

    @webpack-bot
    webpack-bot
    on May 1, 2018
    Contributor
    More actions

    Issue was closed because of inactivity.

    If you think this is still a valid issue, please file a new issue with additional information.

  7. webpack-bot
    closed this as completedon May 1, 2018
  8. tigt commented on Aug 1, 2019

    @tigt
    tigt
    on Aug 1, 2019
    More actions

    I think this might already be supported if you pass 'base64url' to hashDigest:

    The encoding to use when generating the hash. All encodings from Node.JS' hash.digest are supported.

    —Output | webpack § output.hashDigest

    'base64' - Base64 encoding. When creating a Buffer from a string, this encoding will also correctly accept "URL and Filename Safe Alphabet" as specified in RFC 4648, Section 5.

    —Node.js docs § Buffers and Character Encodings

    This encoding may be referred to as "base64url". This encoding should not be regarded as the same as the "base64" encoding and should not be referred to as only "base64".

    —RFC 4648 § Base 64 Encoding with URL and Filename Safe Alphabet

  9. tigt commented on Aug 1, 2019

    @tigt
    tigt
    on Aug 1, 2019
    More actions

    Whoops, looks like not quite. Node transparently consumes base64url if passed in for a Buffer, but they’re unsure if they should implement producing it as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: staleNo author response after a needs: request; close candidate

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402775 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.