Documentation
¶
Overview ¶
Package blake3otp provides BLAKE3-based hash implementations for use with one-time passwords (OTP).
The package defines hash functions (blake3otp.New256, blake3otp.New384, blake3otp.New512) that wrap the BLAKE3 hash function from the github.com/zeebo/blake3 package. These functions return hash instances that implement the hash.Hash interface, allowing them to be used as drop-in replacements for other hash functions in OTP implementations.
Usage:
hasher := blake3otp.New512() // Use the hasher with the OTP implementation
The package provides the following functions:
- blake3otp.New256: Returns a new instance of the BLAKE3 hash with a 256-bit output size.
- blake3otp.New384: Returns a new instance of the BLAKE3 hash with a 384-bit output size.
- blake3otp.New512: Returns a new instance of the BLAKE3 hash with a 512-bit output size.
The returned hash instances implement the hash.Hash interface, so they can be used directly with OTP libraries that expect a hash function.
Note: The BLAKE3 hash functions provided by this package are secure and efficient hashing algorithms. However, it's important to ensure that the secret key used with the OTP implementation is kept secure and not disclosed to unauthorized parties. Also, note that some 2FA mobile apps might not support these hash functions, so it is recommended to build your own 2FA mobile apps for compatibility.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func New256 ¶
New256 returns a new instance of the Blake3otp hash with a 256-bit output size. The returned hash implements the hash.Hash interface.
Types ¶
type Blake3otp ¶
type Blake3otp struct {
// contains filtered or unexported fields
}
Blake3otp is a struct that wraps the BLAKE3 hash function. It implements the hash.Hash interface.