Browse Source

change string bytes get function

master
filesite 8 months ago
parent
commit
c48bb41a8e
  1. 3
      common.mjs

3
common.mjs

@ -5,6 +5,7 @@ @@ -5,6 +5,7 @@
import fs from 'node:fs';
import { readdir, readFile } from 'node:fs/promises';
import { resolve } from 'node:path';
import { Buffer } from 'node:buffer';
import md5 from 'md5';
class Common {
@ -209,7 +210,7 @@ class Common { @@ -209,7 +210,7 @@ class Common {
}
byteSize(str) {
return new Blob([str]).size;
return Buffer.byteLength(str, 'utf8');
}
}

Loading…
Cancel
Save