RandStringBytesMaskImprSrcSB() — gin Function Reference
Architecture documentation for the RandStringBytesMaskImprSrcSB() function in bytesconv_test.go from the gin codebase.
Entity Profile
Dependency Diagram
graph TD 906ff1c0_0648_d845_043e_dd1afe635fbf["RandStringBytesMaskImprSrcSB()"] a351a42e_df95_8d3f_6808_84177715971a["TestStringToBytes()"] a351a42e_df95_8d3f_6808_84177715971a -->|calls| 906ff1c0_0648_d845_043e_dd1afe635fbf style 906ff1c0_0648_d845_043e_dd1afe635fbf fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
internal/bytesconv/bytesconv_test.go lines 62–79
func RandStringBytesMaskImprSrcSB(n int) string {
sb := strings.Builder{}
sb.Grow(n)
// A src.Int63() generates 63 random bits, enough for letterIdxMax characters!
for i, cache, remain := n-1, src.Int63(), letterIdxMax; i >= 0; {
if remain == 0 {
cache, remain = src.Int63(), letterIdxMax
}
if idx := int(cache & letterIdxMask); idx < len(letterBytes) {
sb.WriteByte(letterBytes[idx])
i--
}
cache >>= letterIdxBits
remain--
}
return sb.String()
}
Domain
Subdomains
Called By
Source
Frequently Asked Questions
What does RandStringBytesMaskImprSrcSB() do?
RandStringBytesMaskImprSrcSB() is a function in the gin codebase.
What calls RandStringBytesMaskImprSrcSB()?
RandStringBytesMaskImprSrcSB() is called by 1 function(s): TestStringToBytes.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free