// SPDX-FileCopyrightText: 2023 The Pion community <https://pion.ly>// SPDX-License-Identifier: MIT
// Package util contains small helpers used across the repo
package utilimport ()// BigEndianUint24 returns the value of a big endian uint24.func ( []byte) uint32 {iflen() < 3 {return0 } := make([]byte, 4)copy([1:], )returnbinary.BigEndian.Uint32()}// PutBigEndianUint24 encodes a uint24 and places into out.func ( []byte, uint32) { := make([]byte, 4)binary.BigEndian.PutUint32(, )copy(, [1:])}// PutBigEndianUint48 encodes a uint64 and places into out.func ( []byte, uint64) { := make([]byte, 8)binary.BigEndian.PutUint64(, )copy(, [2:])}// Max returns the larger value.func (, int) int {if > {return }return}// AddUint48 appends a big-endian, 48-bit value to the byte string.// Remove if / when https://github.com/golang/crypto/pull/265 is merged// upstream.func ( *cryptobyte.Builder, uint64) { .AddBytes([]byte{byte( >> 40), byte( >> 32), byte( >> 24), byte( >> 16), byte( >> 8), byte()})}
The pages are generated with Goldsv0.8.2. (GOOS=linux GOARCH=amd64)
Golds is a Go 101 project developed by Tapir Liu.
PR and bug reports are welcome and can be submitted to the issue list.
Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds.