Skip to content

Something weird with F.toString #26

@TheBojda

Description

@TheBojda

This is my code:

const transactionHash = poseidon([1,2,3,4])
console.log(poseidon.F.toString(transactionHash, 16))
poseidon.F.toRprLE(transactionHash)
console.log(transactionHash)

The result is:

Uint8Array(32) [
  101,   4,  37, 101, 223,  37, 165, 186,
   61, 102, 224,  28, 187,  14, 230,  55,
  152,  11,  81, 228,  64, 250, 206, 157,
  215, 253, 193, 182, 125, 134, 156,  41
]

If I comment out the 2. line (F.toString with the console.log), the result changes to:

Uint8Array(32) [
   55, 101, 196, 198, 129, 138, 140,  45,
  142,  65, 142,  10,  95, 238,   7, 252,
   22,  29,  96,  57, 220, 241,  71, 104,
   73, 180, 227,  41, 211, 150,  75,  39
]

toString should be stateless. Or not?

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions