Summary
When using Buffer.from() with hexadecimal, the data should be truncated when the first non-hexadecimal value is encountered, as it does in Node.js.
Version
deno 2.5.4 (stable, release, x86_64-unknown-linux-gnu)
v8 14.0.365.5-rusty
typescript 5.9.2
OS
Linux Mint 22 Wilma
Steps to reproduce
- Create file
test.mjs with the following content:
import { Buffer } from 'node:buffer';
console.log(Buffer.from('1ag123', 'hex'));
- Run file
deno test.mjs.
Expected Behaviour
<Buffer 1a>
Actual Behaviour
<Buffer 1a 01 23>