You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

25 lines
444 B

package main
import (
"encoding/hex"
"fmt"
"testing"
"github.com/iden3/go-iden3-crypto/poseidon"
)
func TestLen(t *testing.T) {
m := []byte("45")
h, err := poseidon.HashBytes(m)
if err != nil {
t.Fatal(err)
}
fmt.Println("bigint", h.String())
fmt.Println("length", len(h.Bytes()))
fmt.Println("bytes", h.Bytes())
fmt.Println("hex", hex.EncodeToString(h.Bytes()))
if len(h.Bytes()) != 31 {
t.Fatal("expected 31 bytes")
}
}