jbub / banking

Banking library written in Go.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

calculateMod returns incorrect result on 32 bit platforms (like wasm)

dkegel-fastly opened this issue · comments

64 bit values need to be int64 to run properly on 32 bit platforms, which do still exist :-)

Pull request coming.

Test case:

package main

import "github.com/jbub/banking/iban"

func main() {
	_, err := iban.New("AL50134113214854624345996786")
	if err != nil {
		println(err.Error())
	}
}

Here's one way to run it as a 32 bit program from anywhere (assuming you have tinygo installed); there may be other ways.

tinygo run -target wasi main.go

Expected output: nothing.
When bug present, prints an error.

From tinygo-org/tinygo#2642