{"record":{"id":"3f24b6d9d5d8c864","repo":"grafana/k6","slug":"invalid-output-encoding-s","errorCode":null,"errorMessage":"invalid output encoding: %s","messagePattern":"invalid output encoding: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/js/modules/k6/crypto/crypto.go","lineNumber":259,"sourceCode":"\tswitch outputEncoding {\n\tcase \"base64\":\n\t\treturn base64.StdEncoding.EncodeToString(sum), nil\n\n\tcase \"base64url\":\n\t\treturn base64.URLEncoding.EncodeToString(sum), nil\n\n\tcase \"base64rawurl\":\n\t\treturn base64.URLEncoding.WithPadding(base64.NoPadding).EncodeToString(sum), nil\n\n\tcase \"hex\":\n\t\treturn hex.EncodeToString(sum), nil\n\n\tcase \"binary\":\n\t\tab := hasher.runtime.NewArrayBuffer(sum)\n\t\treturn &ab, nil\n\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"invalid output encoding: %s\", outputEncoding)\n\t}\n}\n","sourceCodeStart":241,"sourceCodeEnd":262,"githubUrl":"https://github.com/grafana/k6/blob/01ffac6f245854c1b8adc6a69857c76a15f90022/internal/js/modules/k6/crypto/crypto.go#L241-L262","documentation":"Raised in Hasher.Digest's output-encoding switch: the computed sum is ready, but the requested outputEncoding ('%s') matches none of base64, base64url, base64rawurl, hex, or binary. This is a pure argument-validation guard on the encoding name — the hash itself succeeded and nothing is wrong with the input data or algorithm.","triggerScenarios":"Thrown at internal/js/modules/k6/crypto/crypto.go:259 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use one of: base64, base64url, base64rawurl, hex, or binary","Check spelling and case — the encoding name is matched exactly","Omit the encoding argument if the default output is acceptable"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"01ffac6f245854c1b8adc6a69857c76a15f90022","analyzedAt":"2026-08-18T03:05:52.393Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}