Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/buger/jsonparser
/ functions
Functions
1,014 in github.com/buger/jsonparser
⨍
Functions
1,014
◇
Types & classes
26
↓ 193 callers
Function
Get
* Get - Receives data structure, and key path to extract value from. Returns: `value` - Pointer to original data structure containing key value, or j
parser.go:1227
↓ 69 callers
Function
ArrayEach
SYS-REQ-006, SYS-REQ-028, SYS-REQ-029, SYS-REQ-052, SYS-REQ-053, SYS-REQ-055, SYS-REQ-083 ArrayEach is used when iterating arrays, accepts a callback
parser.go:1262
↓ 68 callers
Function
Delete
* Del - Receives existing data structure, path to delete. Returns: `data` - return modified data */ SYS-REQ-010, SYS-REQ-033, SYS-REQ-034, SYS-REQ-
parser.go:874
↓ 63 callers
Function
Set
* Set - Receives existing data structure, path to set, and data to set at that key. Returns: `value` - modified byte array `err` - On any parsing er
parser.go:1018
↓ 47 callers
Function
GetString
SYS-REQ-002, SYS-REQ-071, SYS-REQ-072, SYS-REQ-073, SYS-REQ-074 GetString returns the value retrieved by `Get`, cast to a string if possible, trying t
parser.go:1489
↓ 45 callers
Function
GetInt
GetInt returns the value retrieved by `Get`, cast to a int64 if possible. If key data type do not match, it will return an error. SYS-REQ-003, SYS-REQ
parser.go:1535
↓ 45 callers
Function
ObjectEach
SYS-REQ-007, SYS-REQ-030, SYS-REQ-031, SYS-REQ-032, SYS-REQ-054, SYS-REQ-084 ObjectEach iterates over the key-value pairs of a JSON object, invoking a
parser.go:1363
↓ 44 callers
Function
EachKey
SYS-REQ-008, SYS-REQ-085, SYS-REQ-111
parser.go:530
↓ 44 callers
Function
ParseInt
ParseInt parses a Number ValueType into a Go int64 SYS-REQ-015, SYS-REQ-039, SYS-REQ-040, SYS-REQ-058, SYS-REQ-059, SYS-REQ-064
parser.go:1609
↓ 43 callers
Method
String
SYS-REQ-001
parser.go:738
↓ 41 callers
Function
ParseString
ParseString parses a String ValueType into a Go string (the main parsing work is unescaping the JSON string) SYS-REQ-014, SYS-REQ-038, SYS-REQ-060, SY
parser.go:1588
↓ 34 callers
Function
nothing
Just for emulating field access, so it will not throw "evaluated but not used" Benchmark helper for STK-REQ-001, STK-REQ-003, STK-REQ-004, STK-REQ-005
benchmark/benchmark_small_payload_test.go:28
↓ 33 callers
Function
GetUnsafeString
SYS-REQ-011, SYS-REQ-080, SYS-REQ-081, SYS-REQ-082 GetUnsafeString returns the value retrieved by `Get`, use creates string without memory allocation
parser.go:1476
↓ 24 callers
Function
ParseBoolean
ParseBoolean parses a Boolean ValueType into a Go bool (not particularly useful, but here for completeness) SYS-REQ-012, SYS-REQ-036, SYS-REQ-057, SYS
parser.go:1575
↓ 17 callers
Function
GetBoolean
GetBoolean returns the value retrieved by `Get`, cast to a bool if possible. The offset is the same as in `Get`. If key data type do not match, it wil
parser.go:1556
↓ 17 callers
Function
ParseFloat
ParseNumber parses a Number ValueType into a Go float64 SYS-REQ-013, SYS-REQ-037, SYS-REQ-065
parser.go:1599
↓ 17 callers
Function
Unescape
unescape unescapes the string contained in 'in' and returns it as a slice. If 'in' contains no escaped characters: Returns 'in'. Else, if 'out' is of
escape.go:206
↓ 17 callers
Function
newRNG
(seed int64)
property_test.go:37
↓ 14 callers
Function
addSeeds
(f *testing.F)
fuzz_native_test.go:52
↓ 14 callers
Function
runNoPanic
Regression coverage for the empty-string key path component hazard (hazard-sweep finding). A caller passing "" as a path component used to trigger `ru
empty_key_path_test.go:23
↓ 14 callers
Function
runWithCapture
(target string, data []byte, fn func([]byte))
fuzz_native_test.go:103
↓ 14 callers
Function
stringEnd
SYS-REQ-045 Tries to find the end of string Support if string contains escaped quote symbols.
parser.go:280
↓ 12 callers
Function
GetFloat
GetFloat returns the value retrieved by `Get`, cast to a float64 if possible. The offset is the same as in `Get`. If key data type do not match, it wi
parser.go:1515
↓ 11 callers
Method
CodecDecodeSelf
Benchmark harness support for STK-REQ-004.
benchmark/benchmark_codecgen.go:1112
↓ 11 callers
Function
nextToken
SYS-REQ-001 Find position of next character which is not whitespace reqproof:lemma nextToken_in_range func(data []byte) bool { r := nextToken(dat
parser.go:225
↓ 11 callers
Function
tokenEnd
SYS-REQ-044 reqproof:lemma tokenEnd_in_range func(data []byte) bool { r := tokenEnd(data) return r >= 0 && r <= len(data) } reqproof:lemma
parser.go:53
↓ 10 callers
Function
searchKeys
SYS-REQ-001, SYS-REQ-020, SYS-REQ-021, SYS-REQ-022, SYS-REQ-023, SYS-REQ-047, SYS-REQ-111
parser.go:360
↓ 8 callers
Method
UnmarshalEasyJSON
Benchmark harness support for STK-REQ-004.
benchmark/benchmark_easyjson.go:283
↓ 8 callers
Function
randKey
(r *mathrand.Rand)
property_test.go:82
↓ 7 callers
Function
runGetTests
Test helper for SYS-REQ-001, SYS-REQ-002, SYS-REQ-003, SYS-REQ-004, SYS-REQ-005, and SYS-REQ-011.
parser_test.go:1234
↓ 6 callers
Method
CodecEncodeSelf
Benchmark harness support for STK-REQ-004.
benchmark/benchmark_codecgen.go:1053
↓ 6 callers
Method
MarshalJSONBuf
Benchmark harness support for STK-REQ-004.
benchmark/benchmark_ffjson.go:685
↓ 6 callers
Function
blockEnd
SYS-REQ-046 Find end of the data structure, array or object. For array openSym and closeSym will be '[' and ']', for object '{' and '}'
parser.go:330
↓ 6 callers
Function
encodingJSONNoPanic
============================================================================= Shared helpers =========================================================
encoding_json_fuzz_test.go:113
↓ 6 callers
Function
randomBytes
randomBytes returns arbitrary (usually non-JSON) bytes from a seeded RNG.
property_test.go:130
↓ 6 callers
Function
recoverNoPanic
recoverNoPanic runs fn and reports whether it returned without panicking.
property_test.go:140
↓ 6 callers
Function
splitPathComponents
splitPathComponents interprets the fuzz path bytes as a '/'-separated list of key components. Empty segments (from "", "a/", "/a", "a//b", etc.) becom
path_fuzz_test.go:119
↓ 6 callers
Function
truncateForMsg
truncateForMsg renders a byte slice for inclusion in an error message, truncating very large inputs (e.g. the 100 KB deep-nesting seed) so test output
encoding_json_fuzz_test.go:127
↓ 5 callers
Method
MarshalEasyJSON
Benchmark harness support for STK-REQ-004.
benchmark/benchmark_easyjson.go:278
↓ 5 callers
Function
decodeSingleUnicodeEscape
decodeSingleUnicodeEscape decodes a single \uXXXX escape sequence. The prefix \u is assumed to be present and is not checked. In JSON, these escapes c
escape.go:77
↓ 5 callers
Function
decodeUnicodeEscape
(in []byte)
escape.go:115
↓ 5 callers
Function
findKeyStart
SYS-REQ-001, SYS-REQ-020, SYS-REQ-024
parser.go:94
↓ 5 callers
Function
genDeepNesting
genDeepNesting returns deeply-nested JSON array bytes. When closed is true the structure is complete ([[[...1...]]]); when false it is left unclosed (
encoding_json_fuzz_test.go:139
↓ 5 callers
Function
oracleNewRNG
oracleNewRNG returns a seeded RNG. Distinct name from property_test.go's newRNG so the two files can evolve independently without collision.
reference_oracle_test.go:119
↓ 4 callers
Method
UnmarshalJSONFFLexer
Benchmark harness support for STK-REQ-004.
benchmark/benchmark_ffjson.go:716
↓ 4 callers
Function
applyMutation
applyMutation picks one operator at random and applies it.
json_fuzz_test.go:544
↓ 4 callers
Function
equalStr
See fastbytes_unsafe.go for explanation on why *[]byte is used (signatures must be consistent with those in that file)
bytes_safe.go:12
↓ 4 callers
Function
findStructuralBytes
findStructuralBytes returns the positions of all bytes in data that match any of targets. Returns nil if none are found.
json_fuzz_test.go:554
↓ 4 callers
Function
genJSON
genJSON returns a valid JSON document generated from the grammar. The output is always valid JSON per RFC 8259 (the corpus-sanity test asserts json.Va
json_fuzz_test.go:156
↓ 4 callers
Function
internalGet
SYS-REQ-001
parser.go:1233
↓ 4 callers
Function
lastToken
SYS-REQ-001 Find position of last character which is not whitespace reqproof:lemma lastToken_in_range func(data []byte) bool { r := lastToken(dat
parser.go:263
↓ 4 callers
Function
randomJSONValue
randomJSONValue builds a random nested Go value suitable for encoding/json.Marshal. The shape (depth, breadth, alternatives) is chosen by the supplied
property_test.go:44
↓ 4 callers
Function
randomObjectJSONBytes
randomObjectJSONBytes returns marshaled JSON for a random top-level object along with the map so tests can predict values.
property_test.go:104
↓ 4 callers
Function
tokenStart
SYS-REQ-001 reqproof:lemma tokenStart_in_range func(data []byte) bool { r := tokenStart(data) return r >= 0 && r <= len(data) } reqproof:le
parser.go:186
↓ 3 callers
Function
bytesToString
(b *[]byte)
bytes_safe.go:20
↓ 3 callers
Function
calcAllocateSpace
SYS-REQ-009, SYS-REQ-111
parser.go:817
↓ 3 callers
Function
createInsertComponent
SYS-REQ-009, SYS-REQ-110, SYS-REQ-111
parser.go:766
↓ 3 callers
Function
findTokenStart
SYS-REQ-001 NOTE: findTokenStart's two-conditional-return body shape exposes the translator's __early_val scoping bug; we leave it without an in-range
parser.go:80
↓ 3 callers
Function
genValue
genValue appends one JSON value to buf, chosen from a weighted distribution that favors containers at shallow depth (to exercise nesting) and scalars
json_fuzz_test.go:165
↓ 3 callers
Function
getType
SYS-REQ-001, SYS-REQ-027
parser.go:1150
↓ 3 callers
Function
newRandFromSeed
============================================================================= Deterministic RNG seeding from fuzz inputs =============================
json_fuzz_test.go:129
↓ 3 callers
Function
oracleRandomJSONBytes
oracleRandomJSONBytes returns marshaled JSON for a random value, plus the Go value itself (so callers can walk the tree to predict sub-values).
reference_oracle_test.go:256
↓ 3 callers
Function
parseInt
About 2x faster then strconv.ParseInt because it only supports base 10, which is enough for JSON
bytes.go:9
↓ 3 callers
Function
pathShapeMatchesRoot
pathShapeMatchesRoot reports whether the path is semantically applicable to the JSON data's container structure. Used to gate the json.Valid post-cond
path_fuzz_test.go:417
↓ 3 callers
Function
pickExistingPath
--------------------------------------------------------------------------- Path picker — walks a random Go value tree to produce a path that EXISTS.
reference_oracle_test.go:270
↓ 3 callers
Function
randomJSONBytes
randomJSONBytes returns marshaled JSON for any random value.
property_test.go:120
↓ 3 callers
Function
referenceStringEnd
============================================================================= Focused equivalence tests for the stringEnd fast path (PR #285-style "fa
optimization_equiv_test.go:26
↓ 3 callers
Function
runParseTests
Test helper for SYS-REQ-012, SYS-REQ-013, SYS-REQ-014, and SYS-REQ-015.
parser_test.go:2194
↓ 2 callers
Function
FuzzDelete
SYS-REQ-010
fuzz.go:33
↓ 2 callers
Function
FuzzEachKey
SYS-REQ-008
fuzz.go:13
↓ 2 callers
Function
FuzzGetBoolean
SYS-REQ-005
fuzz.go:116
↓ 2 callers
Function
FuzzGetFloat
SYS-REQ-004
fuzz.go:98
↓ 2 callers
Function
FuzzGetInt
SYS-REQ-003
fuzz.go:107
↓ 2 callers
Function
FuzzGetString
SYS-REQ-002
fuzz.go:89
↓ 2 callers
Function
FuzzGetUnsafeString
SYS-REQ-011
fuzz.go:125
↓ 2 callers
Function
FuzzObjectEach
SYS-REQ-007
fuzz.go:48
↓ 2 callers
Function
FuzzParseBool
SYS-REQ-012
fuzz.go:74
↓ 2 callers
Function
FuzzParseFloat
SYS-REQ-013
fuzz.go:56
↓ 2 callers
Function
FuzzParseInt
SYS-REQ-015
fuzz.go:65
↓ 2 callers
Function
FuzzParseString
SYS-REQ-014
fuzz.go:4
↓ 2 callers
Function
FuzzSet
SYS-REQ-009
fuzz.go:39
↓ 2 callers
Method
UnmarshalJSONFFLexer
Benchmark harness support for STK-REQ-004.
benchmark/benchmark_ffjson.go:61
↓ 2 callers
Method
UnmarshalJSONFFLexer
Benchmark harness support for STK-REQ-004.
benchmark/benchmark_ffjson.go:1242
↓ 2 callers
Method
UnmarshalJSONFFLexer
Benchmark harness support for STK-REQ-004.
benchmark/benchmark_ffjson.go:1796
↓ 2 callers
Function
WriteToBuffer
SYS-REQ-009
parser.go:860
↓ 2 callers
Function
appendUnicodeEscape
appendUnicodeEscape appends a `\uXXXX` escape sequence for the given code point to buf. Does NOT validate cp — callers use it for both valid BMP code
json_fuzz_test.go:500
↓ 2 callers
Function
compareGetToOracle
compareGetToOracle compares jsonparser.Get's output to the expected Go value (the reference oracle's prediction). Returns true iff they agree.
reference_oracle_test.go:346
↓ 2 callers
Function
containerIs
============================================================================= Enhanced path-shape checker (catches nested D6 divergences) ============
json_fuzz_test.go:1000
↓ 2 callers
Method
decSlicePtrtoCBAvatar
Benchmark harness support for STK-REQ-004.
benchmark/benchmark_codecgen.go:2627
↓ 2 callers
Method
decSlicePtrtoDSTopic
Benchmark harness support for STK-REQ-004.
benchmark/benchmark_codecgen.go:2729
↓ 2 callers
Method
decSlicePtrtoDSUser
Benchmark harness support for STK-REQ-004.
benchmark/benchmark_codecgen.go:2831
↓ 2 callers
Function
genKeyPath
============================================================================= Adversarial key-path generator =========================================
json_fuzz_test.go:935
↓ 2 callers
Function
h2I
reqproof:lemma h2I_range func(c byte) bool { r := h2I(c) return r == -1 || (r >= 0 && r <= 15) } reqproof:lemma h2I_decimal_digit func(c byte) bool {
escape.go:60
↓ 2 callers
Function
hexDigit
hexDigit returns a single lowercase hexadecimal digit byte.
json_fuzz_test.go:485
↓ 2 callers
Function
looksLikeJSON
============================================================================= The fuzzer (testing.F, native go-fuzz) =================================
json_fuzz_test.go:1480
↓ 2 callers
Function
oracleRandomJSONValue
oracleRandomJSONValue builds a random nested Go value suitable for json.Marshal. It is intentionally richer than property_test.go's generator: it emit
reference_oracle_test.go:163
↓ 2 callers
Function
parseFloat
(b *[]byte)
bytes_safe.go:16
↓ 2 callers
Function
pathShapeMatchesData
pathShapeMatchesData is a stricter version of pathShapeMatchesRoot that also verifies container-type compatibility at EVERY nesting level, not just th
json_fuzz_test.go:1023
↓ 2 callers
Function
pickAdversarialPath
pickAdversarialPath produces a path that may NOT exist in v, including out-of-range indices and empty components — exactly the inputs that exposed PR
reference_oracle_test.go:305
↓ 2 callers
Function
runEncodingJSONGates
============================================================================= Gate runner (runs Gates A–G on a single input) =========================
encoding_json_fuzz_test.go:627
next →
1–100 of 1,014, ranked by callers