MCPcopy Create free account
hub / github.com/sergi/go-diff / getBits

Function getBits

diffmatchpatch/stringutil.go:116–118  ·  view source on GitHub ↗

Helper for getting a sequence of bits from an integer.

(i uint32, cnt byte, from byte)

Source from the content-addressed store, hash-verified

114
115// Helper for getting a sequence of bits from an integer.
116func getBits(i uint32, cnt byte, from byte) byte {
117 return byte((i >> from) & ((1 << cnt) - 1))
118}
119
120// Converts an integer in the range 0~1112060 into a rune.
121// Based on the ranges table in https://en.wikipedia.org/wiki/UTF-8

Callers 1

intToRuneFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected