Vixen
02b45cc4
csharp
public static class ContentHash

Turns bytes into the ObjectId that names them.

No guide page documents this yet — the page shows what the code says about itself.

Remarks

This is the function Vixen.Core deliberately does not have. ObjectId is 128 bits of identity, formatting, parsing and ordering, and nothing else — because XxHash128 lives in a NuGet package and taking it would have cost Vixen.Core's "no dependencies beyond BCL" rule for a type that does not need the algorithm. The code that hashes has the content in front of it, and that code is here.

Non-cryptographic on purpose. An id is a name, not a signature: it exists so that two identical chunks are one chunk, so that a corrupted read is noticed, and so that an update can tell what changed. Anything that needs to resist a deliberate collision needs a signature over the bundle, which is a shipping concern and not this one.

Methods (2)

  • public static ObjectId Compute(ReadOnlySpan<byte> content)

    Hashes bytes into the id that names them.

  • public static ulong TypeId(Type type)

    Hashes a type's name into the identifier a chunk header carries.

Used by (21)

  • ContentAddressablesRemote
  • AssetTextureSourceTestsVixen.Engine.Renderer.Tests
  • CacheWorldVixen.Assets.Tests
  • ContentUpdateVixen.Assets
  • ObjectDatabaseVixen.Core.Serialization
  • ObjectDatabaseTestsVixen.Core.Serialization.Tests
  • RemoteWorldVixen.Assets.Tests
  • SerializerRegistryVixen.Core.Serialization
  • UpdateWorldVixen.Assets.Tests
  • WorldVixen.Assets.Tests
  • WorldRendererTestsVixen.Engine.Renderer.Tests
  • ContentBuilderVixen.Editor.Assets
  • ContentBuilderTestsVixen.Editor.Assets.Tests
  • ContentPipelineVixen.Editor.Assets
  • ContentServerVixen.ContentServer
  • ContentServerTestsVixen.ContentServer.Tests
  • DoctorRunnerVixen.Cli
  • ImportPipelineVixen.Editor.Assets
  • LooseContentVixen.Editor.Assets
  • RemoteContentMountTestsVixen.App.Tests
  • VixenCommandTestsVixen.Cli.Tests