@majikah/majik-bytes 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -437,7 +437,12 @@ export class MajikBytes {
437
437
  throw new MajikBytesError("Cannot compute dimensions for empty byte array", "INVALID_INPUT");
438
438
  }
439
439
  const requiredPixels = Math.ceil(byteCount / 3);
440
- const width = Math.ceil(Math.sqrt(requiredPixels));
440
+ // Calculate a square-ish width, but force it to be at least 22 pixels
441
+ // so the 64-byte SHA-3-512 hash can safely fit in the final hash row.
442
+ let width = Math.ceil(Math.sqrt(requiredPixels));
443
+ if (width < 22) {
444
+ width = 22;
445
+ }
441
446
  const dataRows = Math.ceil(requiredPixels / width);
442
447
  const dataPixels = width * dataRows;
443
448
  return { width, height: dataRows, dataPixels, dataRows };
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@majikah/majik-bytes",
3
3
  "type": "module",
4
4
  "description": "MajikBytes isa TypeScript utility for lossless byte ↔ media conversion. It allows you to safely and losslessly encode arbitrary data (Files, JSON, Strings, ArrayBuffers) directly into standard PNG images or structured TXT files.",
5
- "version": "0.0.1",
5
+ "version": "0.0.2",
6
6
  "license": "Apache-2.0",
7
7
  "author": "Zelijah",
8
8
  "main": "./dist/index.js",