Skip to content

Conversation

@webmaster128
Copy link
Contributor

Before this change, it was not possible to decode an arbitrary string from user input without preprocessing it for the library. The reason is we don't always have the strong type ${Prefix}1${string} or even ${string}1${string} available. A cast from string to ${string}1${string} is unsafe without an extra runtime check.

Even the tests file in this project mark the use of string inputs as type errors:

Bildschirmfoto 2025-10-07 um 15 49 35

But it turns out genBech32 has the overload and runtime checks already. It just needs to be exposed to the user.

Closes #43

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add length limit to encodeFromBytes/decodeToBytes

2 participants