Skip to content
Open
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions Sources/WebAuthn/Helpers/ChallengeGenerator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,12 @@
//
//===----------------------------------------------------------------------===//

package struct ChallengeGenerator: Sendable {
public struct ChallengeGenerator: Sendable {
public static let challengeSize: Int = 32

var generate: @Sendable () -> [UInt8]

package static var live: Self {
.init(generate: { [UInt8].random(count: 32) })
.init(generate: { [UInt8].random(count: challengeSize) })
}
}
2 changes: 1 addition & 1 deletion Sources/WebAuthn/Helpers/Duration+Milliseconds.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
//
//===----------------------------------------------------------------------===//

extension Duration {
public extension Duration {
/// The value of a positive duration in milliseconds, suitable to be encoded in WebAuthn types.
var milliseconds: Int64 {
let (seconds, attoseconds) = self.components
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

import Foundation

extension KeyedDecodingContainer {
public extension KeyedDecodingContainer {
func decodeBytesFromURLEncodedBase64(forKey key: KeyedDecodingContainer.Key) throws -> [UInt8] {
guard let bytes = try decode(
URLEncodedBase64.self,
Expand Down
Loading