MCPcopy Create free account
hub / github.com/egonelbre/exp / PackNybbleUnroll

Function PackNybbleUnroll

permutation/code.go:289–302  ·  view source on GitHub ↗
(perm [base]byte)

Source from the content-addressed store, hash-verified

287}
288
289func PackNybbleUnroll(perm [base]byte) int {
290 return int(perm[0]) |
291 int(perm[1])<<(4*1) |
292 int(perm[2])<<(4*2) |
293 int(perm[3])<<(4*3) |
294 int(perm[4])<<(4*4) |
295 int(perm[5])<<(4*5) |
296 int(perm[6])<<(4*6) |
297 int(perm[7])<<(4*7) |
298 int(perm[8])<<(4*8) |
299 int(perm[9])<<(4*9) |
300 int(perm[10])<<(4*10) |
301 int(perm[11])<<(4*11)
302}
303
304func UnpackNybbleUnroll(v int) [base]byte {
305 const mask = 1<<4 - 1

Callers 2

CodeCopyBitFunction · 0.85

Calls

no outgoing calls

Tested by 1