mcc on Nostr: Okay so yes I get it random indexing into a UTF-8 string is a difficult problem but ...
Okay so yes I get it random indexing into a UTF-8 string is a difficult problem but since Rust already has a byte array guaranteed to have valid UTF-8, then it ought to be possible to define an *index* which is guaranteed to refer to the start of a valid UTF-8 character and which therefore could be used for random indexing into some_string.chars()
Published at
2024-11-13 13:22:16Event JSON
{
"id": "45b2dbe650220628e08b9cbde1ac66ad99b23c5b96e2988f30b01bf5d5661948",
"pubkey": "a3162b9720f6b515ac4bd22d5ea4abf0f85f5685130dca40f46fe684fe85b255",
"created_at": 1731504136,
"kind": 1,
"tags": [
[
"proxy",
"https://mastodon.social/users/mcc/statuses/113475855064641657",
"activitypub"
]
],
"content": "Okay so yes I get it random indexing into a UTF-8 string is a difficult problem but since Rust already has a byte array guaranteed to have valid UTF-8, then it ought to be possible to define an *index* which is guaranteed to refer to the start of a valid UTF-8 character and which therefore could be used for random indexing into some_string.chars()",
"sig": "44e5544c7dc37aca4d09e927c32291b3ad13fa064bf21d3f0a3db37482a5258771b0cc884fbd21852ce37b9331980effeaade5112c334338337d5c40faed3930"
}