diff --git a/src/keri/core/serder.ts b/src/keri/core/serder.ts index d2cd3dfd..217fa6c1 100644 --- a/src/keri/core/serder.ts +++ b/src/keri/core/serder.ts @@ -153,7 +153,7 @@ export function sizeify( } let raw = dumps(ked, kind); - const size = raw.length; + const size = new TextEncoder().encode(raw).length; ked['v'] = versify(ident, version, kind, size); diff --git a/test/core/serder.test.ts b/test/core/serder.test.ts index 1b489e07..65fe2f06 100644 --- a/test/core/serder.test.ts +++ b/test/core/serder.test.ts @@ -91,5 +91,10 @@ describe('Serder', () => { aid0 = new Prefixer({ code: MtrDex.Blake3_256 }, ked0); assert.equal(aid0.qb64, 'ECHOi6qRaswNpvytpCtpvEh2cB2aLAwVHBLFinno3YVW'); + + const ked1 = ked0; + ked1.a = { n: 'Lenksjö' }; + const serder1 = new Serder(ked1); + assert.equal(serder1.ked.v, 'KERI10JSON000139_'); }); });