MCPcopy Create free account
hub / github.com/apache/fory / MetaStringHash

Method MetaStringHash

csharp/src/Fory/TypeResolver.cs:1649–1667  ·  view source on GitHub ↗
(MetaString metaString)

Source from the content-addressed store, hash-verified

1647 }
1648
1649 private static ulong MetaStringHash(MetaString metaString)
1650 {
1651 (ulong h1, _) = MurmurHash3.X64_128(metaString.Bytes, 47);
1652 long hash = unchecked((long)h1);
1653 if (hash != long.MinValue)
1654 {
1655 hash = Math.Abs(hash);
1656 }
1657
1658 ulong result = unchecked((ulong)hash);
1659 if (result == 0)
1660 {
1661 result += 256;
1662 }
1663
1664 result &= 0xffffffffffffff00;
1665 result |= (byte)metaString.Encoding;
1666 return result;
1667 }
1668
1669 private TypeInfo CreateBindingCore(Type type)
1670 {

Callers

nothing calls this directly

Calls 2

X64_128Method · 0.80
AbsMethod · 0.80

Tested by

no test coverage detected