Socket
Socket
Sign inDemoInstall

loader-utils

Package Overview
Dependencies
Maintainers
3
Versions
50
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

loader-utils - npm Package Compare versions

Comparing version 3.2.2 to 3.3.0

13

lib/getHashDigest.js

@@ -123,10 +123,15 @@ "use strict";

digestType === "base58" ||
digestType === "base62"
digestType === "base62" ||
digestType === "base64safe"
) {
return encodeBufferToBase(hash.digest(), digestType.substr(4), maxLength);
} else {
return hash.digest(digestType || "hex").substr(0, maxLength);
return encodeBufferToBase(
hash.digest(),
digestType === "base64safe" ? 64 : digestType.substr(4),
maxLength
);
}
return hash.digest(digestType || "hex").substr(0, maxLength);
}
module.exports = getHashDigest;
{
"name": "loader-utils",
"version": "3.2.2",
"version": "3.3.0",
"author": "Tobias Koppers @sokra",

@@ -5,0 +5,0 @@ "description": "utils for webpack loaders",

@@ -79,3 +79,3 @@ # loader-utils

- 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`
- and `length` the length in chars

@@ -85,3 +85,3 @@ - `[hash]` the hash of `options.content` (Buffer) (by default it's the hex digest of the `xxhash64` hash)

- 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`
- and `length` the length in chars

@@ -92,2 +92,4 @@ - `[N]` the N-th match obtained from matching the current file name against `options.regExp`

`digestType` with `base64safe` don't contain `/`, `+` and `=` symbols.
Examples

@@ -163,3 +165,3 @@

- `hashType` one of `xxhash64`, `sha1`, `md4`, `md5`, `sha256`, `sha512` or any other node.js supported hash type
- `digestType` one of `hex`, `base26`, `base32`, `base36`, `base49`, `base52`, `base58`, `base62`, `base64`
- `digestType` one of `hex`, `base26`, `base32`, `base36`, `base49`, `base52`, `base58`, `base62`, `base64`, `base64safe`
- `maxLength` the maximum length in chars

@@ -166,0 +168,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc