File tree Expand file tree Collapse file tree 2 files changed +4
-15
lines changed
Expand file tree Collapse file tree 2 files changed +4
-15
lines changed Original file line number Diff line number Diff line change 4545 "prettier" : " ^3.5.3"
4646 },
4747 "dependencies" : {
48- "@11ty/eleventy-utils" : " ^2.0.1 " ,
48+ "@11ty/eleventy-utils" : " ^2.0.7 " ,
4949 "@rgrove/parse-xml" : " ^4.2.0" ,
5050 "debug" : " ^4.4.0" ,
5151 "flatted" : " ^3.3.3" ,
Original file line number Diff line number Diff line change 11const fs = require ( "node:fs" ) ;
22const path = require ( "node:path" ) ;
3- const { createHash } = require ( "node:crypto" ) ;
4- const { DateCompare } = require ( "@11ty/eleventy-utils" ) ;
3+ const { DateCompare, createHashHexSync } = require ( "@11ty/eleventy-utils" ) ;
54
65const FileCache = require ( "./FileCache.js" ) ;
76const Sources = require ( "./Sources.js" ) ;
@@ -88,22 +87,12 @@ class AssetCache {
8887 // Defult hashLength also set in global options, duplicated here for tests
8988 // v5.0+ key can be Array or literal
9089 static getHash ( key , hashLength = 30 ) {
91- let hash = createHash ( "sha256" ) ;
92-
9390 if ( ! Array . isArray ( key ) ) {
9491 key = [ key ] ;
9592 }
9693
97- for ( let k of key ) {
98- k = "" + k ;
99- if ( k ) {
100- hash . update ( k ) ;
101- } else {
102- throw new Error ( `Not able to convert asset key (${ k } ) to string.` ) ;
103- }
104- }
105-
106- return ( "" + hash . digest ( "hex" ) ) . slice ( 0 , hashLength ) ;
94+ let result = createHashHexSync ( ...key ) ;
95+ return result . slice ( 0 , hashLength ) ;
10796 }
10897
10998 get source ( ) {
You can’t perform that action at this time.
0 commit comments