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