Tags: creachadair/otp
Tags
Release v0.5.3 Maintenance update, no functional changes. Dependencies: - .github: update actions/checkout to v6 - go.mod: update module dependencies - .github: update CI setup-go to v6 Documentation & Testing: - otpauth: mirror the key URI documentation - otp: add some additional formatting test cases
otp: replace the ParseKey method of Config
Instead of mutating the underlying Config, return a modified copy.
For compatibility, retain the existing method, but deprecate it.
Update the tests and examples.
Before:
cfg := otp.Config{/* ... */}
if err := otp.ParseKey("..."); err != nil {
// ...
After:
cfg, err := otp.Config{/* ... */}.WithKey("...")
if err != nil {
// ...
Release v0.4.2 Maintenance release, no functional changes. Update tests, dependencies, and documentation. - otpauth: use cmp.Diff for test result comparison - otpauth: add additional test cases - go.mod: update module dependencies - otp_test: add RFC 6238 SHA256 and SHA512 test vectors (#3)
Change the type signature of the Format callback. (#2) Prior to this change, a custom format function is called after truncating the hash to 31 bits per the RFC 4226 DT algorithm. Instead, pass the unmodified HMAC output to the formatter, and export the truncation algorithm as a helper. This is a breaking change to the package API, but will only affect dependents who define a custom format function not using otp.FormatAlphabet. An existing function of the form func(v uint64, nb int) string { /* ... */ } can be adapted to this new interface by modifying it as follows: func(hash []byte, nb int) string { v := otp.Truncate(hash) /* ... */ } Also: - Update tests and documentation. - Add another example.
PreviousNext