Skip to content

Commit 278f6eb

Browse files
author
434b
committed
First approach to for a toggable printableStringConsumer
1 parent 36e3a09 commit 278f6eb

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

packages/core/FuzzedDataProvider.ts

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -421,15 +421,6 @@ export class FuzzedDataProvider {
421421
return result;
422422
}
423423

424-
/**
425-
* A simple conversion helper that yields the ASCII representation of a character.
426-
* @param char - A single character represented as a number
427-
* @returns The corresponding ASCII character represented as a number
428-
*/
429-
toAscii(char: number) {
430-
return this.lookupTable[char];
431-
}
432-
433424
/**
434425
* Helper function that converts the given string type into one that only
435426
* contains printable characters. The quality of the output heaviliy depends
@@ -451,7 +442,7 @@ export class FuzzedDataProvider {
451442
encoding: BufferEncoding
452443
): string {
453444
for (let i = min; i < max; i++) {
454-
buf[i] = this.toAscii(buf[i]);
445+
buf[i] = this.lookupTable[buf[i]];
455446
}
456447
return buf.subarray(min, max).toString(encoding);
457448
}

0 commit comments

Comments
 (0)