$41 GRAYBYTE WORDPRESS FILE MANAGER $86

SERVER : vnpttt-amd7f72-h1.vietnix.vn #1 SMP Fri May 24 12:42:50 UTC 2024
SERVER IP : 103.200.23.149 | ADMIN IP 216.73.216.22
OPTIONS : CRL = ON | WGT = ON | SDO = OFF | PKEX = OFF
DEACTIVATED : NONE

/usr/lib/golang/src/encoding/json/v2/

HOME
Current File : /usr/lib/golang/src/encoding/json/v2//fold.go
// Copyright 2020 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.

//go:build goexperiment.jsonv2

package json

import (
	"unicode"
	"unicode/utf8"
)

// foldName returns a folded string such that foldName(x) == foldName(y)
// is similar to strings.EqualFold(x, y), but ignores underscore and dashes.
// This allows foldName to match common naming conventions.
func foldName(in []byte) []byte {
	// This is inlinable to take advantage of "function outlining".
	// See https://blog.filippo.io/efficient-go-apis-with-the-inliner/
	var arr [32]byte // large enough for most JSON names
	return appendFoldedName(arr[:0], in)
}
func appendFoldedName(out, in []byte) []byte {
	for i := 0; i < len(in); {
		// Handle single-byte ASCII.
		if c := in[i]; c < utf8.RuneSelf {
			if c != '_' && c != '-' {
				if 'a' <= c && c <= 'z' {
					c -= 'a' - 'A'
				}
				out = append(out, c)
			}
			i++
			continue
		}
		// Handle multi-byte Unicode.
		r, n := utf8.DecodeRune(in[i:])
		out = utf8.AppendRune(out, foldRune(r))
		i += n
	}
	return out
}

// foldRune is a variation on unicode.SimpleFold that returns the same rune
// for all runes in the same fold set.
//
// Invariant:
//
//	foldRune(x) == foldRune(y) ⇔ strings.EqualFold(string(x), string(y))
func foldRune(r rune) rune {
	for {
		r2 := unicode.SimpleFold(r)
		if r2 <= r {
			return r2 // smallest character in the fold set
		}
		r = r2
	}
}

Current_dir [ NOT WRITEABLE ] Document_root [ WRITEABLE ]


[ Back ]
NAME
SIZE
LAST TOUCH
USER
CAN-I?
FUNCTIONS
..
--
16 Dec 2025 9.30 PM
root / root
0755
arshal.go
26.028 KB
4 Dec 2025 6.06 PM
root / root
0644
arshal_any.go
7.862 KB
4 Dec 2025 6.06 PM
root / root
0644
arshal_default.go
58.783 KB
4 Dec 2025 6.06 PM
root / root
0644
arshal_funcs.go
15.352 KB
4 Dec 2025 6.06 PM
root / root
0644
arshal_inlined.go
6.912 KB
4 Dec 2025 6.06 PM
root / root
0644
arshal_methods.go
12.365 KB
4 Dec 2025 6.06 PM
root / root
0644
arshal_time.go
26.76 KB
4 Dec 2025 6.06 PM
root / root
0644
doc.go
15.052 KB
4 Dec 2025 6.06 PM
root / root
0644
errors.go
14.484 KB
4 Dec 2025 6.06 PM
root / root
0644
fields.go
24.172 KB
4 Dec 2025 6.06 PM
root / root
0644
fold.go
1.456 KB
4 Dec 2025 6.06 PM
root / root
0644
intern.go
2.52 KB
4 Dec 2025 6.06 PM
root / root
0644
options.go
9.974 KB
4 Dec 2025 6.06 PM
root / root
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2026 CONTACT ME
Static GIF