Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ ReadObjectIdentifier() [1/2]

static string System.Formats.Asn1.AsnDecoder.ReadObjectIdentifier ( ReadOnlySpan< byte > source,
AsnEncodingRules ruleSet,
Asn1Tag? expectedTag,
out int totalBytesRead )
inlinestaticprivate

Definition at line 1485 of file AsnDecoder.cs.

1486 {
1487 int bytesConsumed;
1489 if (source2.Length < 1)
1490 {
1491 throw new AsnContentException();
1492 }
1493 StringBuilder stringBuilder = new StringBuilder((byte)source2.Length * 4);
1495 if (smallValue.HasValue)
1496 {
1497 long num = smallValue.Value;
1498 byte value;
1499 if (num < 40)
1500 {
1501 value = 0;
1502 }
1503 else if (num < 80)
1504 {
1505 value = 1;
1506 num -= 40;
1507 }
1508 else
1509 {
1510 value = 2;
1511 num -= 80;
1512 }
1513 stringBuilder.Append(value);
1514 stringBuilder.Append('.');
1515 stringBuilder.Append(num);
1516 }
1517 else
1518 {
1520 byte value = 2;
1521 value2 -= (BigInteger)80;
1522 stringBuilder.Append(value);
1523 stringBuilder.Append('.');
1524 stringBuilder.Append(value2.ToString());
1525 }
1526 source2 = source2.Slice(bytesRead);
1527 while (!source2.IsEmpty)
1528 {
1530 stringBuilder.Append('.');
1531 if (smallValue.HasValue)
1532 {
1533 stringBuilder.Append(smallValue.Value);
1534 }
1535 else
1536 {
1537 stringBuilder.Append(largeValue.Value.ToString());
1538 }
1539 source2 = source2.Slice(bytesRead);
1540 }
1542 return stringBuilder.ToString();
1543 }
static void ReadSubIdentifier(ReadOnlySpan< byte > source, out int bytesRead, out long? smallValue, out BigInteger? largeValue)
static ReadOnlySpan< byte > GetPrimitiveContentSpan(ReadOnlySpan< byte > source, AsnEncodingRules ruleSet, Asn1Tag expectedTag, UniversalTagNumber tagNumber, out int bytesConsumed)
Definition AsnDecoder.cs:78

References System.Formats.Asn1.AsnDecoder.GetPrimitiveContentSpan(), System.Formats.Asn1.Asn1Tag.ObjectIdentifier, System.Formats.Asn1.AsnDecoder.ReadSubIdentifier(), System.source, and System.value.