Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/egonelbre/exp
/ PackNybble
Function
PackNybble
permutation/code.go:273–279 ·
view source on GitHub ↗
(perm [base]byte)
Source
from the content-addressed store, hash-verified
271
}
272
273
func
PackNybble(perm [base]byte) int {
274
r := 0
275
for
_, v :=
range
perm {
276
r = r<<4 + int(v)
277
}
278
return
r
279
}
280
281
func
PackTight(perm [base]byte) int {
282
r := 0
Callers
1
BenchmarkPackNybble
Function · 0.85
Calls
no outgoing calls
Tested by
1
BenchmarkPackNybble
Function · 0.68