-
-
Notifications
You must be signed in to change notification settings - Fork 362
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: improve icon generator, use icon*.NODE_ENV.png #172
Changes from all commits
29e7287
5f28044
94c7b4f
a843522
3c311f8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { createHash } from "crypto" | ||
|
||
/** | ||
* Fast hash for local file revving | ||
* DO NOT USE FOR SENSITIVE PURPOSES | ||
* md5 is good enough for file-revving: https://github.com/sindresorhus/rev-hash | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we can even do crc32 for file diff if we want to squeeze out perf There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think even google was struggling at implementing usable crc32 for their storage lol, they had to defer it to another module las time I checked xd |
||
*/ | ||
export const getMd5RevHash = (buff: Buffer) => | ||
createHash("md5").update(buff).digest("hex").slice(0, 18) |
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.
how do we invalidate this cache?
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.
This is just static path cache to avoid extra path resolution. We would invalidate it against the passed down assetDirectory, but that path doesn't change at runtime atm xD