I'm not sure why string level manipulations would be necessary in a structured data format to begin with. You'll update the URL using tooling regardless, so why not utilize the language for it at the expense of a little bit of verbosity?

  !!schema: { url: "https://example.com/people.tn" sha256: "c4d5e6f7…a2b3c4d5" }