MCPcopy Create free account
hub / github.com/blues/note / binExtractInt24

Method binExtractInt24

lib/bulk.go:234–245  ·  view source on GitHub ↗
(ctx context.Context, what string)

Source from the content-addressed store, hash-verified

232}
233
234func (tmplContext *BulkTemplateContext) binExtractInt24(ctx context.Context, what string) (value int32) {
235 bin, success := tmplContext.binExtract(ctx, what, 3)
236 if !success {
237 return
238 }
239 value = int32(bin[0])
240 value = value | (int32(bin[1]) << 8)
241 msb := int8(bin[2])
242 msbSignExtended := int32(msb)
243 value = value | (msbSignExtended << 16)
244 return value
245}
246
247func (tmplContext *BulkTemplateContext) binExtractUint24(ctx context.Context, what string) (value uint32) {
248 bin, success := tmplContext.binExtract(ctx, what, 3)

Callers 1

BulkDecodeNextEntryMethod · 0.95

Calls 1

binExtractMethod · 0.95

Tested by

no test coverage detected