All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog and this project adheres to Semantic Versioning.
- Crystal 0.31.0 changed the behaviour of
Int#/
in favour ofInt#//
for integer division. This affected the base32 module, which no longer builds. Updated to point at a fork of base32 that does build in 0.31.0.
- Crystal 0.30.0 deprecated
URI.escape
in favour ofURI.encode_www_form
. Updated this to match the original behaviour (withspace_to_plus: false
). - Crystal 0.28.0 deprecated
Time.now
. Updated to useTime.utc
which is actually more correct according to the RFC. - Crystal 0.29.0 deprecated the behaviour of
Int#/
to return integers. Changed to useInt#//
instead.
- Support and tests for TOTP with SHA256 and SHA512
- Crystal 0.28.0 changed the first argument for
OpenSSL::HMAC#digest
from a symbol to a type ofOpenSSL::Algorithm
. Updated this within the library thanks to @Xosmond.
- Crystal 0.27.0 changed
Time#epoch
toTime#to_unix
, updated within the library thanks to @Xosmond
- Added
authenticator_uri
toHOTP
andTOTP
objects to generate URIs for 2FA authenticator apps. - Added
base32_secret
to both objects so that users who can't use the URI or QR code can copy the base32 secret to their authenticator app.
- Added an
allowed_drift
toverify
methods so that codes can be valid longer.
- Replaced implementation of
int_to_bytes
withIO::ByteFormat::LittleEndian.encode
thanks to @benoist
- Initial implementation of HOTP and TOTP.