Linux vmi284606.contaboserver.net 4.15.0-213-generic #224-Ubuntu SMP Mon Jun 19 13:30:12 UTC 2023 x86_64
Apache/2.4.57 (Ubuntu)
: 167.86.127.34 | : 216.73.217.1
Cant Read [ /etc/named.conf ]
7.2.24-0ubuntu0.18.04.17
root
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
CREATE RDP
PHP Mailer
BACKCONNECT
UNLOCK SHELL
HASH IDENTIFIER
README
+ Create Folder
+ Create File
/
usr /
local /
go /
src /
strings /
[ HOME SHELL ]
Name
Size
Permission
Action
builder.go
3.48
KB
-rw-r--r--
builder_test.go
7
KB
-rw-r--r--
compare.go
1.06
KB
-rw-r--r--
compare_test.go
2.75
KB
-rw-r--r--
example_test.go
8.71
KB
-rw-r--r--
export_test.go
1.08
KB
-rw-r--r--
reader.go
3.54
KB
-rw-r--r--
reader_test.go
5.9
KB
-rw-r--r--
replace.go
14.44
KB
-rw-r--r--
replace_test.go
14.08
KB
-rw-r--r--
search.go
4.19
KB
-rw-r--r--
search_test.go
1.88
KB
-rw-r--r--
strings.go
27.19
KB
-rw-r--r--
strings_test.go
47.13
KB
-rw-r--r--
Delete
Unzip
Zip
${this.title}
Close
Code Editor : compare_test.go
// Copyright 2013 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package strings_test // Derived from bytes/compare_test.go. // Benchmarks omitted since the underlying implementation is identical. import ( "internal/testenv" . "strings" "testing" "unsafe" ) var compareTests = []struct { a, b string i int }{ {"", "", 0}, {"a", "", 1}, {"", "a", -1}, {"abc", "abc", 0}, {"ab", "abc", -1}, {"abc", "ab", 1}, {"x", "ab", 1}, {"ab", "x", -1}, {"x", "a", 1}, {"b", "x", -1}, // test runtime·memeq's chunked implementation {"abcdefgh", "abcdefgh", 0}, {"abcdefghi", "abcdefghi", 0}, {"abcdefghi", "abcdefghj", -1}, } func TestCompare(t *testing.T) { for _, tt := range compareTests { cmp := Compare(tt.a, tt.b) if cmp != tt.i { t.Errorf(`Compare(%q, %q) = %v`, tt.a, tt.b, cmp) } } } func TestCompareIdenticalString(t *testing.T) { var s = "Hello Gophers!" if Compare(s, s) != 0 { t.Error("s != s") } if Compare(s, s[:1]) != 1 { t.Error("s > s[:1] failed") } } func TestCompareStrings(t *testing.T) { // unsafeString converts a []byte to a string with no allocation. // The caller must not modify b while the result string is in use. unsafeString := func(b []byte) string { return *(*string)(unsafe.Pointer(&b)) } lengths := make([]int, 0) // lengths to test in ascending order for i := 0; i <= 128; i++ { lengths = append(lengths, i) } lengths = append(lengths, 256, 512, 1024, 1333, 4095, 4096, 4097) if !testing.Short() || testenv.Builder() != "" { lengths = append(lengths, 65535, 65536, 65537, 99999) } n := lengths[len(lengths)-1] a := make([]byte, n+1) b := make([]byte, n+1) lastLen := 0 for _, len := range lengths { // randomish but deterministic data. No 0 or 255. for i := 0; i < len; i++ { a[i] = byte(1 + 31*i%254) b[i] = byte(1 + 31*i%254) } // data past the end is different for i := len; i <= n; i++ { a[i] = 8 b[i] = 9 } sa, sb := unsafeString(a), unsafeString(b) cmp := Compare(sa[:len], sb[:len]) if cmp != 0 { t.Errorf(`CompareIdentical(%d) = %d`, len, cmp) } if len > 0 { cmp = Compare(sa[:len-1], sb[:len]) if cmp != -1 { t.Errorf(`CompareAshorter(%d) = %d`, len, cmp) } cmp = Compare(sa[:len], sb[:len-1]) if cmp != 1 { t.Errorf(`CompareBshorter(%d) = %d`, len, cmp) } } for k := lastLen; k < len; k++ { b[k] = a[k] - 1 cmp = Compare(unsafeString(a[:len]), unsafeString(b[:len])) if cmp != 1 { t.Errorf(`CompareAbigger(%d,%d) = %d`, len, k, cmp) } b[k] = a[k] + 1 cmp = Compare(unsafeString(a[:len]), unsafeString(b[:len])) if cmp != -1 { t.Errorf(`CompareBbigger(%d,%d) = %d`, len, k, cmp) } b[k] = a[k] } lastLen = len } }
Close