Skip to content

Commit 0ae0a12

Browse files
committed
First release
1 parent 20e69d4 commit 0ae0a12

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

.gitattributes

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
/.gitattributes export-ignore
2+
/.gitignore export-ignore
3+
/.editorconfig export-ignore
4+
/README.md export-ignore
5+
/spec export-ignore

shard.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: branca
2-
version: 0.3.0
2+
version: 1.0.0
33

44
authors:
55
- Johannes Rabausch <mail@jrabausch.de>

src/branca.cr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ class Branca
5151

5252
# Use custom nonce if set (only for testing).
5353
nonce = @nonce || Nonce.new.to_slice
54-
header = Slice(UInt8).new(1, VERSION.to_u8) + time + nonce
54+
header = Bytes.new(1, VERSION.to_u8) + time + nonce
5555

5656
ciphertext = Bytes.new(payload.size + Mac.size)
5757
LibMonocypher.aead_lock(
@@ -103,7 +103,7 @@ class Branca
103103
timestamp = BigEndian.decode(UInt32, header[1..4])
104104
token = Token.new(payload, timestamp)
105105

106-
raise ExpiredTokenError.new token if ttl > 0 && (timestamp + ttl) < Time.utc.to_unix
106+
raise ExpiredTokenError.new(token) if ttl > 0 && (timestamp + ttl) < Time.utc.to_unix
107107
token
108108
end
109109
end

0 commit comments

Comments
 (0)