You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import { dataUtils } from "npm:@vechain/sdk-core";
import * as ethers from "npm:ethers";
const data = "1";
console.log("dataUtils.encodeBytes32String:", dataUtils.encodeBytes32String(data));
console.log("ethers.encodeBytes32String:", ethers.encodeBytes32String(data));
Screenshots
![DESCRIPTION](LINK.png)
Logs
No response
OS
No response
The text was updated successfully, but these errors were encountered:
ifavo
changed the title
🐛 [BUG] - dataUtils.encodeBytes32String() is left instead of right padding
🐛 [BUG] - encodeBytes32String() is padding on the left instead of right side
May 2, 2024
Description
When using
encodeBytes32String('1')
is behaving different than ethers' version.The result is padded with zero's to the left instead of the right.
1
results with the vechain sdk to:0x0000000000000000000000000000000000000000000000000000000000000031
1
to:0x3100000000000000000000000000000000000000000000000000000000000000
I would expect both functions to generate identical outputs.
Reproduction URL
https://www.val.town/v/ifavo/encodeBytes32String
Reproduction steps
Screenshots
![DESCRIPTION](LINK.png)
Logs
No response
OS
No response
The text was updated successfully, but these errors were encountered: