moderndash
Advanced tools
Comparing version 2.2.2 to 2.2.3
@@ -182,4 +182,5 @@ // src/array/chunk.ts | ||
// src/crypto/hash.ts | ||
var textEncoder = new TextEncoder(); | ||
var textEncoder; | ||
async function hash(data, algorithm = "SHA-256") { | ||
textEncoder ??= new TextEncoder(); | ||
const dataBuffer = typeof data === "string" ? textEncoder.encode(data) : textEncoder.encode(JSON.stringify(data)); | ||
@@ -186,0 +187,0 @@ const hashBuffer = await crypto.subtle.digest(algorithm, dataBuffer); |
{ | ||
"name": "moderndash", | ||
"version": "2.2.2", | ||
"version": "2.2.3", | ||
"type": "module", | ||
@@ -5,0 +5,0 @@ "description": "A lodash inspired utility framework for ESM/Typescript/ESNext", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
269253
2992