0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-29 10:12:39 +01:00

ircd:Ⓜ️🆔 Fix id::event::v3/v4 hashing ctor return view of sigil.

This commit is contained in:
Jason Volk 2019-06-27 19:31:50 -07:00
parent 19df2bbf79
commit 54d5afae49

View file

@ -707,7 +707,15 @@ ircd::m::id::event::v3::v3(const mutable_buffer &out,
}; };
out[0] = '$'; out[0] = '$';
return b64encode_unpadded(out + 1, hash); const string_view hashb64
{
b64encode_unpadded(out + 1, hash)
};
return string_view
{
ircd::data(out), 1 + ircd::size(hashb64)
};
}()} }()}
{ {
} }
@ -742,10 +750,13 @@ ircd::m::id::event::v4::v4(const mutable_buffer &out,
}; };
out[0] = '$'; out[0] = '$';
string_view ret; string_view hashb64;
ret = b64encode_unpadded(out + 1, hash); hashb64 = b64encode_unpadded(out + 1, hash);
ret = b64tob64url(out + 1, ret); hashb64 = b64tob64url(out + 1, hashb64);
return ret; return string_view
{
ircd::data(out), 1 + ircd::size(hashb64)
};
}()} }()}
{ {
} }