(ctx context.Context, what string)
| 307 | } |
| 308 | |
| 309 | func (tmplContext *BulkTemplateContext) binExtractInt48(ctx context.Context, what string) (value int64) { |
| 310 | bin, success := tmplContext.binExtract(ctx, what, 6) |
| 311 | if !success { |
| 312 | return |
| 313 | } |
| 314 | // Sign extend from 48 bits |
| 315 | value = int64(bin[0]) |
| 316 | value = value | (int64(bin[1]) << 8) |
| 317 | value = value | (int64(bin[2]) << 16) |
| 318 | value = value | (int64(bin[3]) << 24) |
| 319 | value = value | (int64(bin[4]) << 32) |
| 320 | value = value | (int64(int8(bin[5])) << 40) // Sign extend from byte 5 |
| 321 | return value |
| 322 | } |
| 323 | |
| 324 | func (tmplContext *BulkTemplateContext) binExtractUint48(ctx context.Context, what string) (value uint64) { |
| 325 | bin, success := tmplContext.binExtract(ctx, what, 6) |
no test coverage detected