Documentation ¶
Index ¶
- func Base64ToByteSlice(input string) []byte
- func ByteSliceToBase64(buf []byte) string
- func ByteSliceToHex(buf []byte) string
- func GetBit[T constraints.Unsigned, U constraints.Integer](v T, n U) T
- func HexToByteSlice(s string) []byte
- func HmacSha1(key, msg []byte) []byte
- func HmacSha256(key, msg []byte) []byte
- func IsAdmin(message string) bool
- func NewSha1() *sha1
- func NewSha256() *sha256
- func Pad(buf []byte, blockSize int) []byte
- func PanicOnErr(err error)
- func PrintTitle(set, challenge int)
- func Randn(n *big.Int) *big.Int
- func Remaining(n, m int) int
- func Root(N int, xx *big.Int) *big.Int
- func RotateLeft(v uint32, n int) uint32
- func RotateRight(v uint32, n int) uint32
- func SetBit[T constraints.Unsigned, U constraints.Integer](a T, n U, v T) T
- func Unpad(buf []byte, blockSize int) ([]byte, error)
- func Xor(buf1, buf2 []byte) []byte
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Base64ToByteSlice ¶
Base64ToByteSlice base64 decodes input
func ByteSliceToBase64 ¶
ByteSliceToBase64 base64 encodes buf per https://www.rfc-editor.org/rfc/rfc4648
func GetBit ¶
func GetBit[T constraints.Unsigned, U constraints.Integer](v T, n U) T
func HmacSha256 ¶
See https://en.wikipedia.org/wiki/HMAC also https://i.kym-cdn.com/photos/images/newsfeed/000/005/713/copypasta.jpg
func IsAdmin ¶
Given a string of the form: key1=value1;key2=value2;... returns true if the first "admin" key is "true".
func Pad ¶
pad buffer using pkcs#7 the padding scheme is documented here: https://datatracker.ietf.org/doc/html/rfc2315#section-10.3
func Root ¶
Root from https://rosettacode.org/wiki/Integer_roots#big.Int
func RotateLeft ¶
func RotateRight ¶
func SetBit ¶
func SetBit[T constraints.Unsigned, U constraints.Integer](a T, n U, v T) T
Types ¶
This section is empty.
Source Files ¶
Click to show internal directories.
Click to hide internal directories.