Closed flcoder closed 4 years ago
I think there are different crc32 algos, and if I recall correctly, ton uses crc32c. Perhaps this could account for the different results.
Yes, TON uses crc32c algorithm so as this library. Differences in example above origin from different serialization flags:
by default toBoc
uses following:
has_idx = true, hash_crc32 = true, has_cache_bits = false, flags = 0
https://github.com/toncenter/tonweb/blob/master/src/boc/Cell.js#L196-197
At the same time fift command 2 boc+>B Bx.
means that you require serialization only with crc32c hash sum, without index.
If you want to get serialization using TonWeb which coincide with your fift result, change
const boc = toHex(await c1.toBoc())
to
const boc = toHex(await c1.toBoc(false, true, false, 0))
Awesome, thanks!
I have ...
producing
{boc: "b5ee9c72c1010301002a000005080202000102000155003f00…00000000000000000000000000000000000000093f985b405"}
and
producing
B5EE9C7241010301002A000202000102000155003F0000000000000000000000000000000000000000000000000000000000000093355B1411