I tried to use fromTrytes()
but the function does not accept trytes with an odd length. The nonce appears to always have an odd length, e.g. EPV9MUTXNFDAFNIQLAZWTOLAFJT
.
1 Answer
fromTrytes
is used to revert the toTrytes
function (which encodes ASCII text into trytes, but will not support all encoded values).
You can use Converter.trits
to convert your trytes into trits, then Converter.value
to convert into an integer value. This works well for tags of milestones or for bundle index fields, but I am not sure whether a nonce is too long for that to fit into a JavaScript number without losing precision.