Ben Lin
2024-06-18 c3e294ff76aff4654c7218645c7a13b539f66a36
internal/vite-config/src/utils/hash.ts
@@ -4,5 +4,13 @@
  const hash = createHash('sha256').update(content);
  return hash.digest('hex').slice(0, hashLSize);
}
function strToHex(str: string) {
  const result: string[] = [];
  for (let i = 0; i < str.length; ++i) {
    const hex = str.charCodeAt(i).toString(16);
    result.push(('000' + hex).slice(-4));
  }
  return result.join('').toUpperCase();
}
export { createContentHash };
export { createContentHash, strToHex };