public static int Calculate(BufferString obj) { var hash1 = 5381; var hash2 = hash1; //unsafe //{ // fixed (char* src = obj.Buffer) // { // var s = src + obj.Offset; // var len = obj.Length; // while (len > 0) // { // hash1 = ((hash1 << 5) + hash1) ^ s[0]; // if (len == 1) // break; // hash2 = ((hash2 << 5) + hash2) ^ s[1]; // s += 2; // len -= 2; // } // } //} return(hash1 + (hash2 * 1566083941)); }
// Token: 0x060011E8 RID: 4584 RVA: 0x0007F130 File Offset: 0x0007D330 public unsafe void AdvanceLowerCase(BufferString obj) { fixed(char *buffer = obj.Buffer) { this.AdvanceLowerCase(buffer + obj.Offset, obj.Length); } }
public static int Calculate(BufferString obj) { var hash1 = 5381; var hash2 = hash1; unsafe { fixed(char *src = obj.Buffer) { var s = src + obj.Offset; var len = obj.Length; while (len > 0) { hash1 = ((hash1 << 5) + hash1) ^ s[0]; if (len == 1) { break; } hash2 = ((hash2 << 5) + hash2) ^ s[1]; s += 2; len -= 2; } } } return(hash1 + (hash2 * 1566083941)); }
public void AdvanceLowerCase(BufferString obj) { //unsafe //{ // fixed (char* src = obj.Buffer) // { // AdvanceLowerCase(src + obj.Offset, obj.Length); // } //} }
public void AdvanceLowerCase(BufferString obj) { unsafe { fixed(char *src = obj.Buffer) { AdvanceLowerCase(src + obj.Offset, obj.Length); } } }
// Token: 0x060011DC RID: 4572 RVA: 0x0007EB50 File Offset: 0x0007CD50 public unsafe static int CalculateLowerCase(BufferString obj) { int num = 5381; int num2 = num; fixed(char *buffer = obj.Buffer) { char *ptr = buffer + obj.Offset; for (int i = obj.Length; i > 0; i -= 2) { num = ((num << 5) + num ^ (int)ParseSupport.ToLowerCase(*ptr)); if (i == 1) { break; } num2 = ((num2 << 5) + num2 ^ (int)ParseSupport.ToLowerCase(ptr[1])); ptr += 2; } } return(num + num2 * 1566083941); }
public static int CompareLowerCaseStringToBufferStringIgnoreCase(string left, BufferString right) { int num = Math.Min(left.Length, right.Length); for (int i = 0; i < num; i++) { int num2 = (int)(left[i] - ParseSupport.ToLowerCase(right[i])); if (num2 != 0) { return(num2); } } return(left.Length - right.Length); }
public static int CompareLowerCaseStringToBufferStringIgnoreCase(string left, BufferString right) { var len = Math.Min(left.Length, right.Length); for (var i = 0; i < len; i++) { var cmp = (int)left[i] - (int)ParseSupport.ToLowerCase(right[i]); if (cmp != 0) { return(cmp); } } return(left.Length - right.Length); }